[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-14 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/11927 )

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

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

Impala has supported an identifier that starts with a number for quite
some time. However, its implementation was broken, especially when it
comes to using it in a fully-qualified name because IDENTIFIER DOT
IDENTIFIER was lexed to DECIMAL_LITERAL. This patch fixes the scanner
to fix support for an idenfifier that starts with a number.
For example:

Before the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is not OK
> select * from foo.123_bar; --> this is not OK

After the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is OK
> select * from foo.123_bar; --> this is OK

Testing:
- Added a new parser test
- Ran all FE tests

Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
Reviewed-on: http://gerrit.cloudera.org:8080/11927
Reviewed-by: Impala Public Jenkins 
Tested-by: Impala Public Jenkins 
---
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
2 files changed, 40 insertions(+), 1 deletion(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
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: merged
Gerrit-Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
Gerrit-Change-Number: 11927
Gerrit-PatchSet: 6
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-14 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins 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 5: Verified+1


--
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: 5
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 10:17:11 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins 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 4:

Build Successful

https://jenkins.impala.io/job/gerrit-code-review-checks/1365/ : Initial code 
review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun 
to run full precommit tests.


--
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: 4
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 07:03:42 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins 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 5:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/3458/ 
DRY_RUN=false


--
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: 5
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 06:10:09 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Fredy Wijaya (Code Review)
Fredy Wijaya 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 4: Code-Review+2

(2 comments)

Carry Bharath's +2.

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

http://gerrit.cloudera.org:8080/#/c/11927/3/fe/src/main/jflex/sql-scanner.flex@414
PS3, Line 414:
> ..starting with digits..
Done


http://gerrit.cloudera.org:8080/#/c/11927/3/fe/src/main/jflex/sql-scanner.flex@508
PS3, Line 508:
> nit:remove?
Done



--
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: 4
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 06:09:30 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Fredy Wijaya (Code Review)
Fredy Wijaya has uploaded a new patch set (#4). ( 
http://gerrit.cloudera.org:8080/11927 )

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

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

Impala has supported an identifier that starts with a number for quite
some time. However, its implementation was broken, especially when it
comes to using it in a fully-qualified name because IDENTIFIER DOT
IDENTIFIER was lexed to DECIMAL_LITERAL. This patch fixes the scanner
to fix support for an idenfifier that starts with a number.
For example:

Before the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is not OK
> select * from foo.123_bar; --> this is not OK

After the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is OK
> select * from foo.123_bar; --> this is OK

Testing:
- Added a new parser test
- Ran all FE tests

Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
---
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
2 files changed, 40 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/27/11927/4
--
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: newpatchset
Gerrit-Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
Gerrit-Change-Number: 11927
Gerrit-PatchSet: 4
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Bharath Vissapragada (Code Review)
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 3: Code-Review+2

(3 comments)

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@511
PS2, Line 511: return newToken(SqlParserSymbols.DOT, yytext());
 :   }
> No, we need to push back the identifier to the input stream to basically "u
Ah, I see it now. Read the jflex docs wrong.


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

http://gerrit.cloudera.org:8080/#/c/11927/3/fe/src/main/jflex/sql-scanner.flex@414
PS3, Line 414:
..starting with digits..


http://gerrit.cloudera.org:8080/#/c/11927/3/fe/src/main/jflex/sql-scanner.flex@508
PS3, Line 508: to
nit:remove?



-- 
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: 3
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 05:43:18 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins 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 3:

Build Successful

https://jenkins.impala.io/job/gerrit-code-review-checks/1364/ : Initial code 
review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun 
to run full precommit tests.


--
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: 3
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 05:23:32 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Fredy Wijaya (Code Review)
Fredy Wijaya 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 3:

(5 comments)

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


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: a dot followed by an identifier will
> I think this stmt is a bit confusing because technically an identifier cann
Yeah, it's confusing after re-reading it. Done.


http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/main/jflex/sql-scanner.flex@416
PS2, Line 416: = \`(\\.|[^\\\`])*\`
> nit: why extra braces? maybe something like follows?
Yeah, not needed. Done.


http://gerrit.cloudera.org:8080/#/c/11927/2/fe/src/main/jflex/sql-scanner.flex@511
PS2, Line 511: return newToken(SqlParserSymbols.DOT, yytext());
 :   }
> instead can't we just do
No, we need to push back the identifier to the input stream to basically "undo" 
the read so that the next scan can process the identifier token. If we don't 
push back we will only get one token (dot) instead of two tokens (dot and 
identifier).


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: bar
> for a moment I was wondering why this is a problem :) Maybe mention exponen
Done



--
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: 3
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 04:52:51 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Fredy Wijaya (Code Review)
Fredy Wijaya has uploaded a new patch set (#3). ( 
http://gerrit.cloudera.org:8080/11927 )

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

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

Impala has supported an identifier that starts with a number for quite
some time. However, its implementation was broken, especially when it
comes to using it in a fully-qualified name because IDENTIFIER DOT
IDENTIFIER was lexed to DECIMAL_LITERAL. This patch fixes the scanner
to fix support for an idenfifier that starts with a number.
For example:

Before the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is not OK
> select * from foo.123_bar; --> this is not OK

After the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is OK
> select * from foo.123_bar; --> this is OK

Testing:
- Added a new parser test
- Ran all FE tests

Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
---
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
2 files changed, 39 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/27/11927/3
--
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: newpatchset
Gerrit-Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
Gerrit-Change-Number: 11927
Gerrit-PatchSet: 3
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Bharath Vissapragada (Code Review)
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   ). 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 
Gerrit-Reviewer: Bharath Vissapragada 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Paul Rogers 
Gerrit-Comment-Date: Wed, 14 Nov 2018 04:31:46 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Fredy Wijaya (Code Review)
Fredy Wijaya has removed Vuk Ercegovac from this change.  ( 
http://gerrit.cloudera.org:8080/11927 )

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


Removed reviewer Vuk Ercegovac.
--
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: deleteReviewer
Gerrit-Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
Gerrit-Change-Number: 11927
Gerrit-PatchSet: 2
Gerrit-Owner: Fredy Wijaya 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins 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:

Build Successful

https://jenkins.impala.io/job/gerrit-code-review-checks/1360/ : Initial code 
review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun 
to run full precommit tests.


--
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 
Gerrit-Reviewer: Fredy Wijaya 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Jim Apple 
Gerrit-Reviewer: Vuk Ercegovac 
Gerrit-Comment-Date: Tue, 13 Nov 2018 23:29:32 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-941: Fix support for an identifier that starts with a number

2018-11-13 Thread Fredy Wijaya (Code Review)
Fredy Wijaya has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/11927


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

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

Impala has supported an identifier that starts with a number for quite
some time. However, its implementation is broken, especially when it
comes to using it in a fully-qualified name. This patch fixes the
scanner to fix support for an idenfifier that starts with a number.
For example:

Before the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is not OK
> select * from foo.123_bar; --> this is not OK

After the fix:
> select * from 123_bar; --> this is OK
> select * from foo. 123_bar; --> this is OK
> select * from foo .123_bar; --> this is OK
> select * from foo.123_bar; --> this is OK

Testing:
- Added a new parser test
- Ran all FE tests

Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
---
M fe/src/main/jflex/sql-scanner.flex
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
2 files changed, 40 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/27/11927/2
--
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: newchange
Gerrit-Change-Id: I8a715be73553247ce80a1ba841712191d64f9730
Gerrit-Change-Number: 11927
Gerrit-PatchSet: 2
Gerrit-Owner: Fredy Wijaya