Qifan Chen has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18829 )

Change subject: IMPALA-7942 (part 1): Add query hints for table cardinalities
......................................................................


Patch Set 7:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/18829/5/fe/src/main/java/org/apache/impala/analysis/TableRef.java
File fe/src/main/java/org/apache/impala/analysis/TableRef.java:

http://gerrit.cloudera.org:8080/#/c/18829/5/fe/src/main/java/org/apache/impala/analysis/TableRef.java@176
PS5, Line 176: tableNumRowsHint_
> Yes, this situation would not throw exception or error according my test.
IMHO this can lead to inconsistency in the plan, depending on where the num row 
hints are specified in the query and how they are processed by the code.


http://gerrit.cloudera.org:8080/#/c/18829/6/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:

http://gerrit.cloudera.org:8080/#/c/18829/6/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java@5046
PS6, Line 5046: Syntax error in line 1
> This is a good idea, but not easy to achieve. Here are two mainly exception
Yeah, I agree with you in that in this case it may be hard to figure out the 
exact location directly in the parser.

I ran a simple query from cli as follows. It looks like the user can easily 
spot the problem. Seems what you have is okay. 

Query: select * from foo  /* +TABLE_NUM_ROWS(1.0) */
Query submitted at: 2022-09-15 14:42:09 (Coordinator: http://qifan-10229:25000)
ERROR: ParseException: Syntax error in line 1:
select * from foo  /* +TABLE_NUM_ROWS(1.0) */
                                      ^
Encountered: DECIMAL LITERAL
Expected: DEFAULT, IDENTIFIER

CAUSED BY: Exception: Syntax error

Could not execute command: select * from foo  /* +TABLE_NUM_ROWS(1.0) */



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f0c773f4e67782a1428db64062f68afbd257af7
Gerrit-Change-Number: 18829
Gerrit-PatchSet: 7
Gerrit-Owner: wangsheng <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Fucun Chu <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Qifan Chen <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: wangsheng <[email protected]>
Gerrit-Comment-Date: Thu, 15 Sep 2022 18:50:50 +0000
Gerrit-HasComments: Yes

Reply via email to