Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14389

Beeline should not output query and prompt to stdout



    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 2.4.0
    • Component/s: Beeline
    • Labels:


      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.

      .vihang-MBP:bin vihang$ ./beeline --showheader=false --outformat=tsv2 -u "jdbc:hive2://localhost:10000" -f /tmp/query.sql > /tmp/query.out 2> /tmp/query.err
      $ cat /tmp/query.out
      1: jdbc:hive2://localhost:10000/default> select * from likes limit 4;
      | 1         | chocolate    |
      | 1         | car          |
      | 1         | games        |
      | 1         | chess        |
      1: jdbc:hive2://localhost:10000/default>
      1: jdbc:hive2://localhost:10000/default>

      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.


        1. HIVE-14389.01.patch
          6 kB
          Vihang Karajgaonkar
        2. HIVE-14389.02.patch
          6 kB
          Vihang Karajgaonkar
        3. HIVE-14389.03.patch
          6 kB
          Vihang Karajgaonkar
        4. HIVE-14389.04.patch
          6 kB
          Vihang Karajgaonkar

          Issue Links



              • Assignee:
                vihangk1 Vihang Karajgaonkar
                vihangk1 Vihang Karajgaonkar
              • Votes:
                0 Vote for this issue
                6 Start watching this issue


                • Created: