[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16195002#comment-16195002 ] Vihang Karajgaonkar commented on HIVE-14389: Thats the behavior which was fixed by this patch. The query text should not be mixed with the results because if you want to process the results (to load as data somewhere else for example) then you will have to manually clean it up by removing the query text. You can always add the query text to your results file if really want by redirecting the stderr to the same file using {{beeline --verbose=true -f hadoop_query.hql > test.txt 2>&1}} > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Fix For: 3.0.0, 2.4.0 > > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16194981#comment-16194981 ] Sanman Ganthe commented on HIVE-14389: -- Command: beeline --verbose=true -f hadoop_query.hql > test.txt Output in test.txt +---+-+- | column 1 | column 2| +---+-+- | A | AA | | A | AA | | A | AA | | A | AA | I want to see the query and output. This is what we would get before HDP 2.6.2 +---+-+- | column 1 | column 2| +---+-+- | A | AA | | A | AA | | A | AA | | A | AA | > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Fix For: 3.0.0, 2.4.0 > > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16194899#comment-16194899 ] Vihang Karajgaonkar commented on HIVE-14389: Hi [~sanmanganthe] Can you please provide more details with an example? Do you mean that the query is not available on stderr as well? > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Fix For: 3.0.0, 2.4.0 > > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16194808#comment-16194808 ] Sanman Ganthe commented on HIVE-14389: -- Hi. I was not getting the query even after i used --verbose=true. I have to redirect the output with the query into a text file. > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Fix For: 3.0.0, 2.4.0 > > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16008408#comment-16008408 ] Vihang Karajgaonkar commented on HIVE-14389: vector_if_expr is a flaky test reported in HIVE-15776. explainanalyze_3 and explainuser_3 have been failing since last many builds and unrelated to this patch. [~ychena] Can this be merged? Thanks! > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16007567#comment-16007567 ] Hive QA commented on HIVE-14389: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12867625/HIVE-14389.04.patch {color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 3 failed/errored test(s), 10687 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[vector_if_expr] (batchId=144) org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainanalyze_3] (batchId=97) org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainuser_3] (batchId=97) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/5209/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/5209/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-5209/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 3 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12867625 - PreCommit-HIVE-Build > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16007476#comment-16007476 ] Thejas M Nair commented on HIVE-14389: -- +1 > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16007023#comment-16007023 ] Yongzhi Chen commented on HIVE-14389: - PATCH 4 looks good. +1 > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch, HIVE-14389.04.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16006884#comment-16006884 ] Yongzhi Chen commented on HIVE-14389: - [~vihangk1], are the test failures related? Especially org.apache.hive.beeline.TestBeeLineWithArgs.testTabInScriptFile ? Thanks > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16006133#comment-16006133 ] Hive QA commented on HIVE-14389: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12867465/HIVE-14389.03.patch {color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 3 failed/errored test(s), 10682 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[vector_join30] (batchId=149) org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainanalyze_3] (batchId=97) org.apache.hive.beeline.TestBeeLineWithArgs.testTabInScriptFile (batchId=219) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/5187/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/5187/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-5187/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 3 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12867465 - PreCommit-HIVE-Build > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16006049#comment-16006049 ] Peter Vary commented on HIVE-14389: --- +1 (non binding) If you have time it might be a good idea to add a negative test as well, so we can be sure, that the prompt, and warnings and so on is not showing up in the out. But it might be an overkill. What do you think? > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16005669#comment-16005669 ] Vihang Karajgaonkar commented on HIVE-14389: Thanks for the review [~pvary]. I manually tested against the test cases in HIVE-14525 like you pointed and they seem to be working fine. Here is the output of the test cases {noformat} vihang-MBP:bin vihang$ cat /tmp/test.sql select * from names; vihang-MBP:bin vihang$ beeline --showheader=false --outputformat=tsv2 >stdout 2>stderr -f /tmp/test.sql 1>stdout 2>stderr vihang-MBP:bin vihang$ vihang-MBP:bin vihang$ vihang-MBP:bin vihang$ cat stdout 1 John 2 Jack 3 Tom 4 Jerry {noformat} {noformat} vihang-MBP:bin vihang$ echo -e 'select\n"foo",\n"bar"' | beeline --showheader=false --outputformat=tsv2 >stdout 2>stderr vihang-MBP:bin vihang$ cat stdout foo bar {noformat} {noformat} vihang-MBP:bin vihang$ ssh localhost test1.sh Running bash_profile vihang-MBP:bin vihang$ vihang-MBP:bin vihang$ cat stdout foo bar vihang-MBP:bin vihang$ {noformat} For the second comment regarding Pattern.CASE_INSENSITIVE, I think I misunderstood the test. I have reverted that part of the change. I realized that {{" nonEscapedSemiColon "}} is needs to be compared from the query text part of the code instead of query result. With this patch the query text will be moved to stderr and hence we need to look for that text in the STDERR. Thanks for catching that! > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch, > HIVE-14389.03.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16004458#comment-16004458 ] Peter Vary commented on HIVE-14389: --- Hi @vihang, Thanks for the patch. We should clean up the BeeLine output! Checked the patch, overall it looks good to me, just a few questions: - Could you please test the cases provided in HIVE-14525 (https://issues.apache.org/jira/browse/HIVE-14525?focusedCommentId=15432183=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15432183) - I am not really understand why the output is changes (Pattern.CASE_INSENSITIVE), or why we have to remove the extra spaces around "nonEscapedSemiColon". Do you know what caused the change? Other than these, the patch looks good to me. Thanks, Peter > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16003605#comment-16003605 ] Hive QA commented on HIVE-14389: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12867174/HIVE-14389.02.patch {color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 1 failed/errored test(s), 10666 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[vector_if_expr] (batchId=144) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/5141/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/5141/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-5141/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 1 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12867174 - PreCommit-HIVE-Build > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16003448#comment-16003448 ] Vihang Karajgaonkar commented on HIVE-14389: [~pvary] [~thejas] Can you please review? > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch, HIVE-14389.02.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HIVE-14389) Beeline should not output query and prompt to stdout
[ https://issues.apache.org/jira/browse/HIVE-14389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002044#comment-16002044 ] Hive QA commented on HIVE-14389: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12867017/HIVE-14389.01.patch {color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 5 failed/errored test(s), 10655 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[list_bucket_dml_9] (batchId=78) org.apache.hive.beeline.TestBeeLineWithArgs.testGetVariableValue (batchId=218) org.apache.hive.beeline.TestBeeLineWithArgs.testQueryNonEscapedSemiColon (batchId=218) org.apache.hive.beeline.TestBeeLineWithArgs.testShowDbInPrompt (batchId=218) org.apache.hive.beeline.TestBeeLineWithArgs.testTabInScriptFile (batchId=218) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/5126/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/5126/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-5126/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 5 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12867017 - PreCommit-HIVE-Build > Beeline should not output query and prompt to stdout > > > Key: HIVE-14389 > URL: https://issues.apache.org/jira/browse/HIVE-14389 > Project: Hive > Issue Type: Improvement > Components: Beeline >Reporter: Vihang Karajgaonkar >Assignee: Vihang Karajgaonkar >Priority: Minor > Attachments: HIVE-14389.01.patch > > > It seems that the Beeline prints the query along with the results in the > stdout when a script file is passed. The output file in the example below > needs to only have the results and not the query. > {noformat} > .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u > "jdbc:hive2://localhost:1" -f /tmp/query.sql > /tmp/query.out 2> > /tmp/query.err > OK > $ cat /tmp/query.out > 1: jdbc:hive2://localhost:1/default> select * from likes limit 4; > +---+--+--+ > | 1 | chocolate| > | 1 | car | > | 1 | games| > | 1 | chess| > +---+--+--+ > 1: jdbc:hive2://localhost:1/default> > 1: jdbc:hive2://localhost:1/default> > $ > {noformat} > A lot of people use HiveCLI and in order to transition from HiveCLI scripts > to Beeline, this needs to be taken care of. The output files generated by > beeline should contain only the results and nothing else. > Similarly, when not in silent mode, query are being printed out on stdout, > which is adding garbage along with results, as just like HIVE CLI does, users > would like to have only the results on stdout, not errors/debugging info/etc, > like the full query. > Query could be printed out, no problem, as long as it is not on stdout (with > results), instead, it must be printed out along with the debugging info. -- This message was sent by Atlassian JIRA (v6.3.15#6346)