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


##########
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:
   I understand the SORT order of the Iceberg is a hint in writing.
   - [Table Spec](https://iceberg.apache.org/spec/#sorting) says, "Writers 
should use this default sort order to sort the data on write, but are not 
required to if the default order is prohibitively expensive, as it would be for 
streaming writes."
   - [Spark 
DDL](https://learn.microsoft.com/en-us/cli/azure/role/definition?view=azure-cli-latest#az-role-definition-list)
 says, "Table write order does not guarantee data order for queries. It only 
affects how data is written to the table."
   - [Trino has a toggle, sorted_writing_enabled, to obey the 
hint](https://trino.io/docs/current/connector/iceberg.html#iceberg-sorted-files)
   
   So, I agree that reusing SORTED BY is confusing. I'm also checking what 
syntaxes are used in other engines...



-- 
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