You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/01/11 12:40:34 UTC

[GitHub] [hive] kasakrisz opened a new pull request #1847: HIVE-24613: Support Values clause without Insert

kasakrisz opened a new pull request #1847:
URL: https://github.com/apache/hive/pull/1847


   ### What changes were proposed in this pull request?
   Prior this patch for defining a row of constant values Select clause could be used:
   ```
   SELECT * FROM t1 foo
   JOIN (select 1,'a') as bar ON foo.col1 = bar.col1
   ```
   This enables the usage of Values clasuse:
   ```
   SELECT * FROM t1 foo
   JOIN (VALUES(1,'a'),(4,'b')) as bar ON foo.col1 = bar.col1
   ```
   
   
   ### Why are the changes needed?
   With Select clause only one row could be defined. There is no such limitation with Values clause.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. From now the Values clause can be used in subqueries and can be a query itself.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest=TestValuesClause -pl parser
   mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=values.q -pl itests/qtest -Pitests
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #1847: HIVE-24613: Support Values clause without Insert

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #1847:
URL: https://github.com/apache/hive/pull/1847#discussion_r555631603



##########
File path: ql/src/test/queries/clientpositive/values.q
##########
@@ -0,0 +1,10 @@
+set hive.cli.print.header=true;
+

Review comment:
       added




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] jcamachor commented on a change in pull request #1847: HIVE-24613: Support Values clause without Insert

Posted by GitBox <gi...@apache.org>.
jcamachor commented on a change in pull request #1847:
URL: https://github.com/apache/hive/pull/1847#discussion_r555534669



##########
File path: ql/src/test/queries/clientpositive/values.q
##########
@@ -0,0 +1,10 @@
+set hive.cli.print.header=true;
+

Review comment:
       Can we add `explain cbo` for some of these queries?

##########
File path: parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g
##########
@@ -306,7 +316,7 @@ valuesTableConstructor
 @init { gParent.pushMsg("values table constructor", state); }
 @after { gParent.popMsg(state); }
     :
-    valueRowConstructor (COMMA! valueRowConstructor)*
+    valueRowConstructor (options{greedy=true;}: COMMA! valueRowConstructor)*

Review comment:
       Can you leave a comment about the `greedy` option behavior?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #1847: HIVE-24613: Support Values clause without Insert

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #1847:
URL: https://github.com/apache/hive/pull/1847#discussion_r555632425



##########
File path: parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g
##########
@@ -306,7 +316,7 @@ valuesTableConstructor
 @init { gParent.pushMsg("values table constructor", state); }
 @after { gParent.popMsg(state); }
     :
-    valueRowConstructor (COMMA! valueRowConstructor)*
+    valueRowConstructor (options{greedy=true;}: COMMA! valueRowConstructor)*

Review comment:
       Removed explicit set of `greedy` option since tests are passed without it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz merged pull request #1847: HIVE-24613: Support Values clause without Insert

Posted by GitBox <gi...@apache.org>.
kasakrisz merged pull request #1847:
URL: https://github.com/apache/hive/pull/1847


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org