Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/19055 )

Change subject: IMPALA-3119: DDL support for bucketed tables
......................................................................


Patch Set 11:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/19055/11//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/19055/11//COMMIT_MSG@19
PS11, Line 19: RANDOM
Is RANDOM actually useful in practise? Could you share some use cases?


http://gerrit.cloudera.org:8080/#/c/19055/10/fe/src/main/cup/sql-parser.cup
File fe/src/main/cup/sql-parser.cup:

http://gerrit.cloudera.org:8080/#/c/19055/10/fe/src/main/cup/sql-parser.cup@1636
PS10, Line 1636:   | opt_bucket_desc:bucket
> Yes, but adding empty to opt_bucket_desc causes a compilation error. So I t
I see. I checked the Hive parser and realized that in HiveQL the SortBy clause 
is part of the BucketClause:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTableCreate/Drop/TruncateTable
https://github.com/apache/hive/blob/16ce75578c265d0aaba7eedafb65658fc569f75e/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g#L1916

  [CLUSTERED BY (col_name, col_name, ...) [SORTED BY (col_name [ASC|DESC], 
...)] INTO num_buckets BUCKETS]

SparkSQL also has the SortBy clause inside the BucketClause:
https://spark.apache.org/docs/3.3.1/sql-ref-syntax-ddl-create-table-hiveformat.html

    [ CLUSTERED BY ( col_name1, col_name2, ...)
        [ SORTED BY ( col_name1 [ ASC | DESC ], col_name2 [ ASC | DESC ], ... ) 
]
        INTO num_buckets BUCKETS ]

I think the syntax consistency in the ecosystem is important. Could you try the 
same syntax that moving the SortBy clause into the Bucket clause? Probably the 
grammer will be easier and we can work around this EMPTY production issue.



--
To view, visit http://gerrit.cloudera.org:8080/19055
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I919b4d4139bc3a7784fa6fdb6f064e25666d548e
Gerrit-Change-Number: 19055
Gerrit-PatchSet: 11
Gerrit-Owner: Baike Xia <xiaba...@163.com>
Gerrit-Reviewer: Aman Sinha <amsi...@cloudera.com>
Gerrit-Reviewer: Baike Xia <xiaba...@163.com>
Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com>
Gerrit-Comment-Date: Thu, 27 Oct 2022 06:08:34 +0000
Gerrit-HasComments: Yes

Reply via email to