kyuubi icon indicating copy to clipboard operation
kyuubi copied to clipboard

[Improvement] Use `beeline --silent=true -u "**" -f` to execute a sql file will get many blank row

Open Ocean22 opened this issue 1 year ago • 10 comments

Code of Conduct

Search before asking

  • [X] I have searched in the issues and found no similar issues.

What would you like to be improved?

1、Use beeline --silent=true -u "**" -f to execute a sql file will get many blank row, and no execute time at tail image

2、Want it no useless blank row,just like spark-sqlclient image

How should we improve?

Maybe can modify source code or add log file to control it

Are you willing to submit PR?

  • [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
  • [X] No. I cannot submit a PR at this time.

Ocean22 avatar Nov 23 '23 03:11 Ocean22

Hello @Ocean22, Thanks for finding the time to report the issue! We really appreciate the community's efforts to improve Apache Kyuubi.

github-actions[bot] avatar Nov 23 '23 03:11 github-actions[bot]

@Ocean22 Thanks for your report. It may be caused by comment lines or empty lines in your script.

wForget avatar Nov 23 '23 07:11 wForget

I did a simple test to reproduce it.

execute script with the following content:

-- 111
-- 2222
-- 333
use sample;













show tables;

get the following print:

image

wForget avatar Nov 23 '23 08:11 wForget

Thanks for your test,and I tested it just now,even no comment lines and empty lines,it will still get blank row.Do you have any way to solve it? image

Ocean22 avatar Nov 23 '23 08:11 Ocean22

The empty lines seem to be printed by ConsoleReader#accept and output to stderr , so we can solve it like:

-f  XXX.sql 2>/dev/null

wForget avatar Nov 23 '23 08:11 wForget

May that cause error messages lost if redirecting stderr to /dev/null?

pan3793 avatar Nov 23 '23 09:11 pan3793

May that cause error messages lost if redirecting stderr to /dev/null?

Yes, error messages are also lost.

wForget avatar Nov 23 '23 11:11 wForget

Thanks for @wForget's guidance,we can merge stderr and stdout,then use grep -v '^\s*$' to solve this problem. image

Ocean22 avatar Dec 05 '23 06:12 Ocean22

no execute time at tail

Hive4 has added a new option to support output execution time, --silent=true --report=true, but Kyuubi uses Hive3.

HIVE-22204: Beeline option to show/not show execution report

https://issues.apache.org/jira/browse/HIVE-22204

cxzl25 avatar Feb 19 '24 13:02 cxzl25

@cxzl25 Thanks for your tip.

Ocean22 avatar Feb 20 '24 01:02 Ocean22