hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1648436 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/parse/ test/queries/clientnegative/ test/results/clientnegative/ test/results/compiler/errors/
Date Mon, 29 Dec 2014 21:44:33 GMT
Author: hashutosh
Date: Mon Dec 29 21:44:33 2014
New Revision: 1648436

URL: http://svn.apache.org/r1648436
Log:
HIVE-8155 :  In select statement after * any random characters are allowed in hive but in
RDBMS its not allowed (Dong Chen via Ashutosh Chauhan)

Added:
    hive/trunk/ql/src/test/queries/clientnegative/select_star_suffix.q
    hive/trunk/ql/src/test/results/clientnegative/select_star_suffix.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g
    hive/trunk/ql/src/test/results/compiler/errors/wrong_distinct2.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g?rev=1648436&r1=1648435&r2=1648436&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g Mon Dec 29
21:44:33 2014
@@ -125,9 +125,10 @@ selectItem
 @init { gParent.pushMsg("selection target", state); }
 @after { gParent.popMsg(state); }
     :
-    ( selectExpression
+    ( expression
       ((KW_AS? identifier) | (KW_AS LPAREN identifier (COMMA identifier)* RPAREN))?
-    ) -> ^(TOK_SELEXPR selectExpression identifier*)
+    ) -> ^(TOK_SELEXPR expression identifier*)
+    | tableAllColumns -> ^(TOK_SELEXPR tableAllColumns)
     ;
 
 trfmClause

Added: hive/trunk/ql/src/test/queries/clientnegative/select_star_suffix.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientnegative/select_star_suffix.q?rev=1648436&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientnegative/select_star_suffix.q (added)
+++ hive/trunk/ql/src/test/queries/clientnegative/select_star_suffix.q Mon Dec 29 21:44:33
2014
@@ -0,0 +1,3 @@
+-- Check SELECT * syntax.
+-- Check that there should not be any identifier after STAR.
+select *abcdef from src;
\ No newline at end of file

Added: hive/trunk/ql/src/test/results/clientnegative/select_star_suffix.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/select_star_suffix.q.out?rev=1648436&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/select_star_suffix.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/select_star_suffix.q.out Mon Dec 29 21:44:33
2014
@@ -0,0 +1 @@
+FAILED: ParseException line 3:8 missing EOF at 'abcdef' near '*'

Modified: hive/trunk/ql/src/test/results/compiler/errors/wrong_distinct2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/compiler/errors/wrong_distinct2.q.out?rev=1648436&r1=1648435&r2=1648436&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/compiler/errors/wrong_distinct2.q.out (original)
+++ hive/trunk/ql/src/test/results/compiler/errors/wrong_distinct2.q.out Mon Dec 29 21:44:33
2014
@@ -1 +1 @@
-Parse Error: line 2:45 cannot recognize input near 'DISTINCT' 'substr' '(' in select expression
\ No newline at end of file
+Parse Error: line 2:45 cannot recognize input near 'DISTINCT' 'substr' '(' in selection target
\ No newline at end of file



Mime
View raw message