Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4610

Impala regexp_replace function colliding with prepared values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 9.2
    • 8.13.3
    • Misc. Connectors
    • None
    • Hide

      Tested scenarios below:

      Query 1 - apostrophe replacement - succeeds:
      {{select impala.regexp_replace(string_column,char(39),concat('&apos',char(59)))
      from some_impala_table
      where date_key = '2016-01-01'
      and customer_id = 112;}}

      Query 2: apostrophe replacement w/prepared values - fails:
      {{select impala.regexp_replace(string_column,char(39),concat('&apos',char(59)))
      from some_impala_table
      where date_key = concat(substring('2016-01-15',1,7),'-01')
      and customer_id = 112;}}

      Query 3: quote replacement w/prepared values - succeeds:
      {{select impala.regexp_replace(string_column,char(34),concat('&quot',char(59)))
      from some_impala_table
      where date_key = concat(substring('2016-01-15',1,7),'-01')
      and customer_id = 112;}}

      Show
      Tested scenarios below: Query 1 - apostrophe replacement - succeeds: {{select impala.regexp_replace(string_column,char(39),concat('&apos',char(59))) from some_impala_table where date_key = '2016-01-01' and customer_id = 112;}} Query 2: apostrophe replacement w/prepared values - fails: {{select impala.regexp_replace(string_column,char(39),concat('&apos',char(59))) from some_impala_table where date_key = concat(substring('2016-01-15',1,7),'-01') and customer_id = 112;}} Query 3: quote replacement w/prepared values - succeeds: {{select impala.regexp_replace(string_column,char(34),concat('&quot',char(59))) from some_impala_table where date_key = concat(substring('2016-01-15',1,7),'-01') and customer_id = 112;}}

      Impala regexp_replace function appears to collide with prepared values only when attemping to replace apostrophe.

      select impala.regexp_replace(string_column,char(39),concat('&apos',char(59)))
      from some_impala_table
      where date_key = concat(substring('2016-01-15',1,7),'-01')
      and customer_id = 112

      Error:

      org.teiid.runtime.client.TeiidClientException: java.lang.RuntimeException: Remote org.teiid.core.TeiidProcessingException: TEIID30504 warehouse: 500051 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: ['2016-01-01'] SQL: SELECT regexp_replace(g_0.`string_column`, '\'', ''') FROM some_impala_table g_0 WHERE g_0.`process_date_key` = ? AND g_0.`customer_id` = 112]
      

              rhn-engineering-shawkins Steven Hawkins
              walla2sl Scott Wallace (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: