deniskuzZ commented on code in PR #5541:
URL: https://github.com/apache/hive/pull/5541#discussion_r1874516015
##########
parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g:
##########
@@ -1840,6 +1841,14 @@ tableImplBuckets
-> ^(TOK_ALTERTABLE_BUCKETS $num)
;
+tableWriteOrdered
+@init { pushMsg("table sorted specification", state); }
+@after { popMsg(state); }
+ :
+ KW_WRITE KW_ORDERED KW_BY sortCols=columnNameOrderList
Review Comment:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL
````
The CLUSTERED BY and SORTED BY creation commands do not affect how data is
inserted into a table – only how it is read. This means that users must be
careful to insert data correctly by specifying the number of reducers to be
equal to the number of buckets, and using CLUSTER BY and SORT BY commands in
their query.
````
@okumin, this PR intends to add support for Iceberg sorted tables, same as
in a trino link @zhangbutao added. I do not really like that we have to create
new syntax for that.
`SORTED BY` kinda makes sense, but it would be overloaded for Iceberg since
it would be used to specify data insert order.
Spark only supports
[alter-table-write-ordered-by](https://iceberg.apache.org/docs/1.7.0/spark-ddl/#alter-table-write-ordered-by)
to define the write order.
Maybe we could have a combination of ALTER + Trino table properties styles?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]