Bharath Vissapragada has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11927 )

Change subject: IMPALA-941: Fix support for an identifier that starts with a 
number
......................................................................


Patch Set 2:

(5 comments)

just a bunch of nits, lgtm otherwise.

http://gerrit.cloudera.org:8080/#/c/11927/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/11927/2//COMMIT_MSG@10
PS2, Line 10: However, its implementation is broken, especially when it
            : comes to using it in a fully-qualified name.
nit: Maybe mention with an example that it was getting lexed to

"IDENTIFIER DECIMAL_LITERAL IDENTIFIER" instead of "IDENTIFIER DOT IDENTIFIER"

I think that makes it super clear.


http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/main/jflex/sql-scanner.flex
File fe/src/main/jflex/sql-scanner.flex:

http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/main/jflex/sql-scanner.flex@414
PS2, Line 414: an identifier that starts with a dot
I think this stmt is a bit confusing because technically an identifier cannot 
start with a dot (x.y should lex to <ident> <dot> <ident>). Maybe clarify that?

Also I think you mean an identifier "starting with digits"...?


http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/main/jflex/sql-scanner.flex@416
PS2, Line 416: (\. {Identifier}|{Identifier}) | "&&" | "||"
nit: why extra braces? maybe something like follows?

IdentifierOrKw = {Identifier} | \. {Identifier} | "&&" | "||"


http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/main/jflex/sql-scanner.flex@511
PS2, Line 511: yypushback(text.length() - 1);
             :     return newToken(SqlParserSymbols.DOT, yytext());
instead can't we just do

return newToken(DOT, text.subString(...))?

IMO that is more readable than resetting the scanner read offset.


http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/test/java/org/apache/impala/analysis/ParserTest.java
File fe/src/test/java/org/apache/impala/analysis/ParserTest.java:

http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/test/java/org/apache/impala/analysis/ParserTest.java@3903
PS2, Line 3903: 4e1
for a moment I was wondering why this is a problem :) Maybe mention exponential 
thing here.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
Gerrit-Change-Number: 11927
Gerrit-PatchSet: 2
Gerrit-Owner: Fredy Wijaya <fwij...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bhara...@cloudera.com>
Gerrit-Reviewer: Fredy Wijaya <fwij...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple-imp...@apache.org>
Gerrit-Reviewer: Paul Rogers <par0...@yahoo.com>
Gerrit-Comment-Date: Wed, 14 Nov 2018 04:31:46 +0000
Gerrit-HasComments: Yes

Reply via email to