SELECT Expression (U-SQL)
The SELECT expression is the transformation and query workhorse. It basically follows the standard SQL SELECT expression.
The logical processing flow of a SELECT expression is as follows: First the rowsets specified in the SELECT’s FROM clause will be combined into the SELECT expression’s rowset. Then the optional WHERE clause’s filter conditions are applied onto the rowset. The GROUP BY clause is then producing groups of rows, optionally filtered with the HAVING clause. The SELECT clause then projects the specified columns and allows aggregating the grouped data as well as transforming the selected data.
Note that unlike in other systems, where a SELECT clause can output results to the user at any time, U-SQL’s current batch-mode centric execution model never outputs a SELECT result directly. Instead, a SELECT expression is always assigned to a rowset expression variable and in the end the script results needs to either be output into files or inserted into tables.
Select_Expression := Select_Clause Select_From_Clause [Where_Clause] [Group_By_Clause] [Order_By_Fetch_Clause].
SELECTclause specifies the resulting structure and values of the rowset of the
FROMclause specifies the input rowsets to the
SELECTexpression and how the rowsets are being combined into the
WHEREclause specifies the filter conditions of the
SELECTexpression which will reduces the rows that are being produced as a result.
GROUP BYclause groups the rows based on the provided expression list into groups that then can be aggregated over with the built-in and user-defined aggregator functions.