[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-20 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14285118#comment-14285118
 ] 

zhaohm3 commented on HIVE-9336:
---

[~xuefuz]

I build Hive with the following comands:

mvn clean install -DskipTests -Phadoop-2 | tee logs/mvn.logs
cd itests
mvn clean install -DskipTests -Phadoop-2 | tee logs/mvn.logs

and after that, I rerun the unit tests through the following commands and all 
report successed without any errors, So I guess that there are some 
differences between my local environment and Hive QA's, or we do not pass the 
same options to mvn when compile and run unit tests, or anything else, Could 
you help me to find what happened?

cd itests

mvn test -Dtest=rg.apache.hadoop.hive.cli.TestMinimrCliDriver 
-Dqfile=index_bitmap_auto.q -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestMinimrCliDriver#testCliDriver_index_bitmap_auto
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver 
-Dqfile=optimize_nullscan.q  -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver#testCliDriver_optimize_nullscan
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testRemoteClient 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testCounters 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testAddJarsAndFiles 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testSimpleSparkJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testErrorJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testJobSubmission 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testMetricsCollection 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hadoop.hive.ql.TestMTQueries#testMTQueries1 
-Dtest.silent=false -Phadoop-2

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> {code}
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> {code}
> The following contents show some ParseExctption stacktrace:
> {code}
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> 

[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-18 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14282228#comment-14282228
 ] 

zhaohm3 commented on HIVE-9336:
---

[~xuefuz]

I rerun the unit tests through the following commands and all report successed 
without any errors, So I guess that there are some 
differences between my local environment and Hive QA's, or we do not pass the 
same options to mvn when compile and run unit tests, or anything else, Could 
you help me to find what happened?

cd itests

mvn test -Dtest=rg.apache.hadoop.hive.cli.TestMinimrCliDriver 
-Dqfile=index_bitmap_auto.q -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestMinimrCliDriver#testCliDriver_index_bitmap_auto
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver 
-Dqfile=optimize_nullscan.q  -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver#testCliDriver_optimize_nullscan
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testRemoteClient 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testCounters 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testAddJarsAndFiles 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testSimpleSparkJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testErrorJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testJobSubmission 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testMetricsCollection 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hadoop.hive.ql.TestMTQueries#testMTQueries1 
-Dtest.silent=false -Phadoop-2

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at or

[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-14 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14278170#comment-14278170
 ] 

zhaohm3 commented on HIVE-9336:
---

@Prasad Mujumdar 

I rerun the unit tests through the following commands and all report success 
without any errors, So I guess that there are some 
differences between my local environment and Hive QA's, or we do not use the 
same options to mvn when compile and run unit tests, or anything else, Could 
you help me to find what happened?

cd itests

mvn test -Dtest=rg.apache.hadoop.hive.cli.TestMinimrCliDriver 
-Dqfile=index_bitmap_auto.q -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestMinimrCliDriver#testCliDriver_index_bitmap_auto
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver 
-Dqfile=optimize_nullscan.q  -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver#testCliDriver_optimize_nullscan
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testRemoteClient 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testCounters 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testAddJarsAndFiles 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testSimpleSparkJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testErrorJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testJobSubmission 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testMetricsCollection 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hadoop.hive.ql.TestMTQueries#testMTQueries1 
-Dtest.silent=false -Phadoop-2

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> 

[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-14 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14278172#comment-14278172
 ] 

zhaohm3 commented on HIVE-9336:
---

@Prasad Mujumdar 

I rerun the unit tests through the following commands and all report success 
without any errors, So I guess that there are some 
differences between my local environment and Hive QA's, or we do not use the 
same options to mvn when compile and run unit tests, or anything else, Could 
you help me to find what happened?

cd itests

mvn test -Dtest=rg.apache.hadoop.hive.cli.TestMinimrCliDriver 
-Dqfile=index_bitmap_auto.q -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestMinimrCliDriver#testCliDriver_index_bitmap_auto
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver 
-Dqfile=optimize_nullscan.q  -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver#testCliDriver_optimize_nullscan
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testRemoteClient 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testCounters 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testAddJarsAndFiles 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testSimpleSparkJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testErrorJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testJobSubmission 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testMetricsCollection 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hadoop.hive.ql.TestMTQueries#testMTQueries1 
-Dtest.silent=false -Phadoop-2

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> 

[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-14 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14278173#comment-14278173
 ] 

zhaohm3 commented on HIVE-9336:
---

@Prasad Mujumdar 

I rerun the unit tests through the following commands and all report success 
without any errors, So I guess that there are some 
differences between my local environment and Hive QA's, or we do not use the 
same options to mvn when compile and run unit tests, or anything else, Could 
you help me to find what happened?

cd itests

mvn test -Dtest=rg.apache.hadoop.hive.cli.TestMinimrCliDriver 
-Dqfile=index_bitmap_auto.q -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestMinimrCliDriver#testCliDriver_index_bitmap_auto
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver 
-Dqfile=optimize_nullscan.q  -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver#testCliDriver_optimize_nullscan
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testRemoteClient 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testCounters 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testAddJarsAndFiles 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testSimpleSparkJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testErrorJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testJobSubmission 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testMetricsCollection 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hadoop.hive.ql.TestMTQueries#testMTQueries1 
-Dtest.silent=false -Phadoop-2

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> 

[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-14 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14278171#comment-14278171
 ] 

zhaohm3 commented on HIVE-9336:
---

@Prasad Mujumdar 

I rerun the unit tests through the following commands and all report success 
without any errors, So I guess that there are some 
differences between my local environment and Hive QA's, or we do not use the 
same options to mvn when compile and run unit tests, or anything else, Could 
you help me to find what happened?

cd itests

mvn test -Dtest=rg.apache.hadoop.hive.cli.TestMinimrCliDriver 
-Dqfile=index_bitmap_auto.q -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestMinimrCliDriver#testCliDriver_index_bitmap_auto
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver 
-Dqfile=optimize_nullscan.q  -Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hadoop.hive.cli.TestSparkCliDriver#testCliDriver_optimize_nullscan
 -Dtest.silent=false -Phadoop-2

mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testRemoteClient 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testCounters 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testAddJarsAndFiles 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testSimpleSparkJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testErrorJob 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hive.spark.client.TestSparkClient#testJobSubmission 
-Dtest.silent=false -Phadoop-2
mvn test 
-Dtest=org.apache.hive.spark.client.TestSparkClient#testMetricsCollection 
-Dtest.silent=false -Phadoop-2
mvn test -Dtest=org.apache.hadoop.hive.ql.TestMTQueries#testMTQueries1 
-Dtest.silent=false -Phadoop-2

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> 

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Status: Patch Available  (was: Open)

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
> at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614721 end=1420595614745 duration=24 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614745 end=1420595614746 duration=1 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (P

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Description: 
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
grouping sets(test.tc1, (test.tc1, test.tc2));
explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
sets(tc2, (tc1 + tc2, tc2));

drop table test;

The following contents show some ParseExctption stacktrace:

2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
(Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
creating a lock manager
2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
(ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
(test.tc1, test.tc2))
2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
(SessionState.java:printError(545)) - FAILED: ParseException line 1:105 missing 
) at ',' near ''
line 1:116 extraneous input ')' expecting EOF near ''
org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at ',' 
near ''
line 1:116 extraneous input ')' expecting EOF near ''
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 

But, Hive will not throw ParseException while handling the follwing HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select tc1, test.tc2 from test group by tc1, test.tc2 grouping 
sets(tc1, (tc1, test.tc2));
explain select tc1+tc2, tc1 from test group by tc1+tc2, tc1 grouping 
sets(tc1, (tc1, tc1 + tc2));
explain select test.tc1, test.tc1 + test.tc2 from test group by test.tc1, 
test.tc1 + test.tc2 grouping sets(test.tc1, (test.tc1), (test.tc1 + test.tc2));

drop table test;

For why and how to solve it, see the attachments: 
Fix-Hive-ParseException-of-Grouping-Sets.htm and HIVE-9336.1.patch


  was:
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQL

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Description: 
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
grouping sets(test.tc1, (test.tc1, test.tc2));
explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
sets(tc2, (tc1 + tc2, tc2));

drop table test;

The following contents show some ParseExctption stacktrace:

2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
(Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
creating a lock manager
2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
(ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
(test.tc1, test.tc2))
2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
(SessionState.java:printError(545)) - FAILED: ParseException line 1:105 missing 
) at ',' near ''
line 1:116 extraneous input ')' expecting EOF near ''
org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at ',' 
near ''
line 1:116 extraneous input ')' expecting EOF near ''
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 

But, Hive will not throw ParseException while handling the follwing HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select tc1, test.tc2 from test group by tc1, test.tc2 grouping 
sets(tc1, (tc1, test.tc2));
explain select tc1+tc2, tc1 from test group by tc1+tc2, tc1 grouping 
sets(tc1, (tc1, tc1 + tc2));
explain select test.tc1, test.tc1 + test.tc2 from test group by test.tc1, 
test.tc1 + test.tc2 grouping sets(test.tc1, (test.tc1), (test.tc1 + test.tc2));

drop table test;

For why and how to solve it, see the attachment: 
Fix-Hive-ParseException-of-Grouping-Sets.htm 


  was:
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table tes

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Status: Open  (was: Patch Available)

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
> at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614721 end=1420595614745 duration=24 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614745 end=1420595614746 duration=1 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (P

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Attachment: HIVE-9336.1.patch

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm, 
> HIVE-9336.1.patch
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
> at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614721 end=1420595614745 duration=24 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614745 end=1420595614746 duration=1 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogg

[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14274623#comment-14274623
 ] 

zhaohm3 commented on HIVE-9336:
---

Or see the attachment: Fix-Hive-ParseException-of-Grouping-Sets.htm

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
> at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614721 end=1420595614745 duration=24 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614745 end=1420595614746 duration=1 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Description: 
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
grouping sets(test.tc1, (test.tc1, test.tc2));
explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
sets(tc2, (tc1 + tc2, tc2));

drop table test;

The following contents show some ParseExctption stacktrace:

2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
(Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
creating a lock manager
2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
(ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
(test.tc1, test.tc2))
2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
(SessionState.java:printError(545)) - FAILED: ParseException line 1:105 missing 
) at ',' near ''
line 1:116 extraneous input ')' expecting EOF near ''
org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at ',' 
near ''
line 1:116 extraneous input ')' expecting EOF near ''
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 

But, Hive will not throw ParseException while handling the follwing HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select tc1, test.tc2 from test group by tc1, test.tc2 grouping 
sets(tc1, (tc1, test.tc2));
explain select tc1+tc2, tc1 from test group by tc1+tc2, tc1 grouping 
sets(tc1, (tc1, tc1 + tc2));
explain select test.tc1, test.tc1 + test.tc2 from test group by test.tc1, 
test.tc1 + test.tc2 grouping sets(test.tc1, (test.tc1), (test.tc1 + test.tc2));

drop table test;

For more details, see the attachment: 
Fix-Hive-ParseException-of-Grouping-Sets.htm


  was:
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table test;
creat

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Attachment: Fix-Hive-ParseException-of-Grouping-Sets.htm

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
> Attachments: Fix-Hive-ParseException-of-Grouping-Sets.htm
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
> at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614721 end=1420595614745 duration=24 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614745 end=1420595614746 duration=1 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (Per

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-12 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Description: 
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
grouping sets(test.tc1, (test.tc1, test.tc2));
explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
sets(tc2, (tc1 + tc2, tc2));

drop table test;

The following contents show some ParseExctption stacktrace:

2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
(Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
creating a lock manager
2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
(ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
(test.tc1, test.tc2))
2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
(SessionState.java:printError(545)) - FAILED: ParseException line 1:105 missing 
) at ',' near ''
line 1:116 extraneous input ')' expecting EOF near ''
org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at ',' 
near ''
line 1:116 extraneous input ')' expecting EOF near ''
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 

But, Hive will not throw ParseException while handling the follwing HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select tc1, test.tc2 from test group by tc1, test.tc2 grouping 
sets(tc1, (tc1, test.tc2));
explain select tc1+tc2, tc1 from test group by tc1+tc2, tc1 grouping 
sets(tc1, (tc1, tc1 + tc2));
explain select test.tc1, test.tc1 + test.tc2 from test group by test.tc1, 
test.tc1 + test.tc2 grouping sets(test.tc1, (test.tc1), (test.tc1 + test.tc2));

drop table test;


  was:
Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select test.tc1, test.tc2 f

[jira] [Updated] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-11 Thread zhaohm3 (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhaohm3 updated HIVE-9336:
--
Status: Patch Available  (was: Open)

> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
> at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614721 end=1420595614745 duration=24 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614745 end=1420595614746 duration=1 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614746 end=1420595614746 duration=0 
> from=

[jira] [Commented] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-11 Thread zhaohm3 (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-9336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14273152#comment-14273152
 ] 

zhaohm3 commented on HIVE-9336:
---

For more details, visit: https://www.zybuluo.com/Spongcer/note/61369


> Fix Hive throws ParseException while handling Grouping-Sets clauses
> ---
>
> Key: HIVE-9336
> URL: https://issues.apache.org/jira/browse/HIVE-9336
> Project: Hive
>  Issue Type: Bug
>  Components: Parser
>Affects Versions: 0.13.1
>Reporter: zhaohm3
> Fix For: 0.14.0
>
>
> Currently, when Hive parses GROUPING SETS clauses, and if there are some 
> expressions that were composed of two or more common subexpressions, then the 
> first element of those expressions can only be a simple Identifier without 
> any qualifications, otherwise Hive will throw ParseException during its 
> parser stage. Therefore, Hive will throw ParseException while parsing the 
> following HQLs:
> drop table test;
> create table test(tc1 int, tc2 int, tc3 int);
> 
> explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
> grouping sets(test.tc1, (test.tc1, test.tc2));
> explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
> sets(tc2, (tc1 + tc2, tc2));
> 
> drop table test;
> The following contents show some ParseExctption stacktrace:
> 2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
> (Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
> creating a lock manager
> 2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
> (ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
> test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
> (test.tc1, test.tc2))
> 2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
> (SessionState.java:printError(545)) - FAILED: ParseException line 1:105 
> missing ) at ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at 
> ',' near ''
> line 1:116 extraneous input ')' expecting EOF near ''
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
> at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
> at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614721 end=1420595614745 duration=24 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogEnd(135)) -  start=1420595614745 end=1420595614746 duration=1 
> from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLogger.java:PerfLogBegin(108)) -  from=org.apache.hadoop.hive.ql.Driver>
> 2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
> (PerfLo

[jira] [Created] (HIVE-9336) Fix Hive throws ParseException while handling Grouping-Sets clauses

2015-01-11 Thread zhaohm3 (JIRA)
zhaohm3 created HIVE-9336:
-

 Summary: Fix Hive throws ParseException while handling 
Grouping-Sets clauses
 Key: HIVE-9336
 URL: https://issues.apache.org/jira/browse/HIVE-9336
 Project: Hive
  Issue Type: Bug
  Components: Parser
Affects Versions: 0.13.1
Reporter: zhaohm3
 Fix For: 0.14.0


Currently, when Hive parses GROUPING SETS clauses, and if there are some 
expressions that were composed of two or more common subexpressions, then the 
first element of those expressions can only be a simple Identifier without any 
qualifications, otherwise Hive will throw ParseException during its parser 
stage. Therefore, Hive will throw ParseException while parsing the following 
HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select test.tc1, test.tc2 from test group by test.tc1, test.tc2 
grouping sets(test.tc1, (test.tc1, test.tc2));
explain select tc1+tc2, tc2 from test group by tc1+tc2, tc2 grouping 
sets(tc2, (tc1 + tc2, tc2));

drop table test;

The following contents show some ParseExctption stacktrace:

2015-01-07 09:53:34,718 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,719 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,721 INFO [main]: ql.Driver 
(Driver.java:checkConcurrency(158)) - Concurrency mode is disabled, not 
creating a lock manager
2015-01-07 09:53:34,721 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,724 INFO [main]: parse.ParseDriver 
(ParseDriver.java:parse(185)) - Parsing command: explain select test.tc1, 
test.tc2 from test group by test.tc1, test.tc2 grouping sets(test.tc1, 
(test.tc1, test.tc2))
2015-01-07 09:53:34,734 ERROR [main]: ql.Driver 
(SessionState.java:printError(545)) - FAILED: ParseException line 1:105 missing 
) at ',' near ''
line 1:116 extraneous input ')' expecting EOF near ''
org.apache.hadoop.hive.ql.parse.ParseException: line 1:105 missing ) at ',' 
near ''
line 1:116 extraneous input ')' expecting EOF near ''
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:210)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:322)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:975)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1040)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,745 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogBegin(108)) - 
2015-01-07 09:53:34,746 INFO [main]: log.PerfLogger 
(PerfLogger.java:PerfLogEnd(135)) - 

But, Hive will not throw ParseException while handling the follwing HQLs:

drop table test;
create table test(tc1 int, tc2 int, tc3 int);

explain select tc1, test.tc2 from test group by tc1, test.tc2 grouping 
sets(tc1, (tc1, test.tc2));
explain select tc1+tc2, tc1 from test group by tc1+tc2, tc1 grouping 
sets(tc1, (tc1, tc1 + tc2));
explain select test.tc1, test.tc1 + test.tc2 from test group by test.tc1, 
test.tc1 + test.tc2 grouping sets(test.tc1, (test.tc1), (test.tc1 + test.tc2));

drop table test;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)