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

Beeline needs to support resolving variables

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.13.0
    • Component/s: None
    • Labels:
      None

      Description

      Previous Hive CLI allows user to specify hive variables at the command line using option "--hivevar". In user's script, reference to a hive variable will be substituted with the value of the variable. In such way, user can parameterize his/her script and invoke the script with different hive variable values. The following script is one usage:

      hive --hivevar
           INPUT=/user/jenkins/oozie.1371538916178/examples/input-data/table
           --hivevar
           OUTPUT=/user/jenkins/oozie.1371538916178/examples/output-data/hive
           -f script.q
      

      script.q makes use of hive variables:

      CREATE EXTERNAL TABLE test (a INT) STORED AS TEXTFILE LOCATION '${INPUT}';
      INSERT OVERWRITE DIRECTORY '${OUTPUT}' SELECT * FROM test;
      

      However, after upgrade to hiveserver2 and beeline, this functionality is missing. Beeline doesn't take --hivevar option, and any hive variable isn't passed to server so it cannot be used for substitution.

      This JIRA is to address this issue, providing a backward compatible behavior at Beeline.

        Attachments

        1. HIVE-4568.8.patch
          12 kB
          Xuefu Zhang
        2. HIVE-4568.7.patch
          8 kB
          Xuefu Zhang
        3. HIVE-4568.6.patch
          7 kB
          Xuefu Zhang
        4. HIVE-4568.5.patch
          7 kB
          Xuefu Zhang
        5. HIVE-4568.4.patch
          7 kB
          Xuefu Zhang
        6. HIVE-4568.3.patch
          7 kB
          Xuefu Zhang
        7. HIVE-4568-2.patch
          7 kB
          Xuefu Zhang
        8. HIVE-4568-1.patch
          8 kB
          Xuefu Zhang
        9. HIVE-4568.patch
          3 kB
          Xuefu Zhang

          Issue Links

            Activity

              People

              • Assignee:
                xuefuz Xuefu Zhang
                Reporter:
                xuefuz Xuefu Zhang
              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: