Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7673

Parse --var variable values to replace variables within the value

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Impala 2.11.0, Impala 3.0
    • Impala 3.1.0
    • Clients
    • None
    • CentOS Linux release 7.4.1708
      CDH 5.14.4
    • ghx-label-6

    Description

      Related to IMPALA-2180

      In working on a query using SET variables, and trying to move them to impala-shell --var options to set the variables, the later variable which depends on the 1st one doesn't have the 1st one be replaced properly like it does with a SET.

      For example:

      --var="DATA_DATE_START='2018-09-28'

      --var="START_ACTION_CLICK_RANGE=from_timestamp(date_sub(to_timestamp(\${var:DATA_DATE_START},'yyyy-MM-dd'), 93), 'yyyy-MM-dd')"

      In the query that gets run, the ${var:START_ACTION_CLICK_RANGE} gets replaced with

      from_timestamp(date_sub(to_timestamp(${var:DATA_DATE_START},'yyyy-MM-dd'), 93), 'yyyy-MM-dd')

      not with

      from_timestamp(date_sub(to_timestamp('2018-09-28','yyyy-MM-dd'), 93), 'yyyy-MM-dd')

      as I would expect it to.

      Attachments

        Activity

          People

            fredyw Fredy Wijaya
            drizzt321 Aaron Baff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: