MaxCompute - Supports ZORDER BY with DISTRIBUTE BY
Feb 08 2021
MaxComputeContent
Target customers: developers and analysts. Features released: When you write data into a table or partition, you can use ZORDER BY in the query statement and specify one or more columns to implement partial sorting before the data is written. This improves the efficiency to query the sorted data records in interactive mode. In this type of query, you can specify one or more columns. MaxCompute now allows you to use ZORDER BY with DISTRIBUTE BY. DISTRIBUTE BY determines the scope of data records and improves the efficiency of ZORDER BY-based data preprocessing. ORDER BY x, y sorts data records based on the ordering of x coming before y. ZORDER BY x, y places rows that have similar x values in adjacent positions and rows that have similar y values in adjacent positions. If the filter condition of an SQL query statement includes sort columns, ORDER BY filters and sorts data records based on x, whereas ZORDER BY filters and sorts data records based on x or on both x and y. After ZORDER BY is executed, data records with adjacent values are grouped together. This increases the column store ratio. ZORDER BY cannot be used with ORDER BY, CLUSTER BY, or SORT BY.