Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3090

sqlline : save SQL to script file and replay from script, results in error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.0.0
    • 1.16.0
    • Client - CLI
    • None
    • ffbb9c7adc6360744bee186e1f69d47dc743f73e

    Description

      Save a SQL query to a script file and replay the SQL from the script file using !run, on sqlline prompt throws error. We should not see the error when we replay the SQL from the script file.

      0: jdbc:drill:schema=dfs.tmp> !script file3
      Saving command script to "/opt/mapr/drill/drill-1.0.0/bin/file3". Enter "script" with no arguments to stop it.
      0: jdbc:drill:schema=dfs.tmp> select * from sys.drillbits;
      +------------+------------+--------------+------------+------------+
      |  hostname  | user_port  | control_port | data_port  |  current   |
      +------------+------------+--------------+------------+------------+
      | centos-04.qa.lab | 31010      | 31011        | 31012      | false      |
      | centos-02.qa.lab | 31010      | 31011        | 31012      | false      |
      | centos-01.qa.lab | 31010      | 31011        | 31012      | false      |
      | centos-03.qa.lab | 31010      | 31011        | 31012      | true       |
      +------------+------------+--------------+------------+------------+
      4 rows selected (0.176 seconds)
      0: jdbc:drill:schema=dfs.tmp> !script
      Script closed. Enter "run /opt/mapr/drill/drill-1.0.0/bin/file3" to replay it.
      0: jdbc:drill:schema=dfs.tmp> !run /opt/mapr/drill/drill-1.0.0/bin/file3
      1/2          select * from sys.drillbits;
      +------------+------------+--------------+------------+------------+
      |  hostname  | user_port  | control_port | data_port  |  current   |
      +------------+------------+--------------+------------+------------+
      | centos-04 | 31010      | 31011        | 31012      | false      |
      | centos-02 | 31010      | 31011        | 31012      | false      |
      | centos-01 | 31010      | 31011        | 31012      | false      |
      | centos-03 | 31010      | 31011        | 31012      | true       |
      +------------+------------+--------------+------------+------------+
      4 rows selected (0.178 seconds)
      2/2          !script
      Usage: script <filename>
      Aborting command set because "force" is false and command failed: "!script"
      

      I looked at the contents of file3 under /opt/mapr/drill/drill-1.0.0/bin
      There seems to be an additional/extra "!script" in the file.

      [root@centos-01 bin]# cat file3
      select * from sys.drillbits;
      !script
      [root@centos-01 bin]# 
      

      Attachments

        Issue Links

          Activity

            People

              arina Arina Ielchiieva
              khfaraaz Khurram Faraaz
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: