okumin commented on code in PR #5541:
URL: https://github.com/apache/hive/pull/5541#discussion_r1875561081


##########
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:
   ## How other Iceberg-friendly query engines support SORT orders
   
   ### ALTER TABLE
   - [Spark supports WRITE ORDERED BY and WRITE LOCALLY ORDERED 
BY](https://iceberg.apache.org/docs/1.7.0/spark-ddl/#alter-table-write-ordered-by)
       - An interesting point is it supports also a task-local ordering
   - [Trino supports it through table 
properties](https://trino.io/docs/current/connector/iceberg.html#alter-table-set-properties)
   - [Dremio supports LOCALSORT 
BY](https://docs.dremio.com/cloud/reference/sql/commands/alter-table)
   
   ### CREATE TABLE
   - [Spark doesn't support 
it?](https://github.com/apache/iceberg/blob/apache-iceberg-1.7.1/spark/v3.5/spark-extensions/src/main/antlr/org.apache.spark.sql.catalyst.parser.extensions/IcebergSqlExtensions.g4)
   - [Trino supports it through table 
properties](https://trino.io/docs/current/connector/iceberg.html#sorted-tables)
   - [Dremio supports LOCALSORT 
BY](https://docs.dremio.com/cloud/reference/sql/commands/create-table/)
   
   ## Related discussions
   
   I found a related discussion although it would not include the conclusion we 
want.
   https://github.com/apache/iceberg/issues/3547
   
   ## My current opinion
   
   If we introduce `ALTER TABLE ... WRITE ORDERED BY`, we can reuse it in 
CREATE TABLE in my opinion. It is consistent and no new keywords are introduced 
for CREATE TABLE. If we don't, I prefer to use a property for both purposes.



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to