U-SQL

  • Cognitive Services with U-SQL (Reference Guide)

    This post is a reference guide to support an event talk or webinar. The content is intended to assist the audience only. Thank you. Abstract Microsoft’s Cognitive Services are basically the best thing since sliced bread, especially for anybody working with data. Artificial intelligence just got packaged and made available for the masses to download. In this short talk, I’ll take you on a whirl wind tour of how to use these massively…

    » Read more
  • Recursive U-SQL With PowerShell (U-SQL Looping)

    In its natural form U-SQL does not support recursive operations and for good reason. This is a big data, scale out, declarative language where the inclusion of procedural, iterative code would be very unnatural. That said, if you must pervert things PowerShell can assist with the looping and dare I say the possibility for dynamic U-SQL. A couple of caveats… From the outset, I accept this abstraction with PowerShell to achieve some…

    » Read more
  • Calling U-SQL Stored Procedures with C# Code Behind

    So friends, some more lessons learnt when developing with U-SQL and Azure Data Lake. I’ll try and keep this short. Problem You have a U-SQL stored procedure written and working fine within your Azure Data Lake Analytics service. But we need to add some more business logic or something requiring a little C# magic. This is the main thing I love about U-SQL, having that C# code behind file where I can extend my normal SQL behaviour. So,…

    » Read more
  • Storing U-SQL Assemblies in Azure Blob Storage

    I’m hoping the title of this post is fairly self explanatory. Your here because like me you found that the MSDN language reference page for creating U-SQL assemblies states that it’s possible to store the DLL’s in Azure Blob Storage. But it doesn’t actually tell you how. Well please continue my friends and I’ll show you how. The offending article: https://msdn.microsoft.com/en-us/library/azure/mt763293.aspx The…

    » Read more
  • Creating a U-SQL Date Dimension & Numbers Table in Azure Data Lake

    Now we all know what a date dimension is and there are plenty of really great examples out there for creating them in various languages. Well, here’s my U-SQL version creating the output from scratch using a numbers table. Remember that U-SQL needs to be handled slightly differently because we don’t have any iterative functionality available. Plus its ability to massively parallelise jobs means we can’t write something that…

    » Read more
  • Passing Parameters to U-SQL from Azure Data Factory

    Let’s try and keep this post short and sweet. Diving right in imagine a scenario where we have an Azure Data Factory (ADF) pipeline that includes activities to perform U-SQL jobs in Azure Data Lake (ADL) Analytics. We want to control the U-SQL by passing the ADF time slice value to the script, hopefully a fairly common use case. This isn’t yet that intuitive when constructing the ADF JSON activity so I hope this post will save…

    » Read more
  • Writing a U-SQL Merge Statement

    Unlike T-SQL, U-SQL does not currently support MERGE statements. Our friend that we have come to know and love since its introduction in SQL Server 2008. Not only that, but U-SQL also doesn’t currently support UPDATE statements either… I know… Open mouth emoji required! This immediately leads to the problem of change detection in our data and how, for example, we should handle the ingestion of a daily rolling 28-day TSV extract,…

    » Read more