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

Bypass lookup function's keycolumn reserved word

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 8.12.x
    • Fix Version/s: 9.3, 9.2.1, 9.1.4
    • Component/s: Query Engine
    • Labels:
      None
    • Environment:

      JDV 6.3.2
      Windows 7, 64-bit

    • Steps to Reproduce:
      Hide

      1 - Create a reference data table that has a column with literal name of "value"
      2 - Use the LOOKUP function with the "value" column in the keyColumn field (3rd argument)

      Show
      1 - Create a reference data table that has a column with literal name of "value" 2 - Use the LOOKUP function with the "value" column in the keyColumn field (3rd argument)

      Description

      When using the Teiid LOOKUP function, the 3rd argument is to specify the keycolumn. In my table, the column I want to reference is literally named "value", which is a SQL reserved word. The generated query chokes on this because it's not expecting a reserved word to be here when parsing the grammar. I've tried quoting and escaping to get around this, but nothing seems to work.

      21:18:55,860 WARN  [org.teiid.PROCESSOR] (Worker16_QueryProcessorQueue167) TEIID30020 Processing exception for request NLkytVFPLOM6.0 'TEIID30328 Unable to evaluate lookup('tdsa_vbl.t_code_translate', 'descr', 'value', 'NAMS'): TEIID31100 Parsing error: Encountered "SELECT [*]VALUE[*] ,DESCR" at line 1, column 8.
      Was expecting: "char" | "date" | "time" | "timestamp" | "cast" | "convert" | "all" | "any" | "array_agg" | "case" ...'. Originally ExpressionEvaluationException QueryParser.java:214. Enable more detailed logging to see the entire stacktrace.
      21:19:13,077 WARN  [org.teiid.PROCESSOR] (Worker16_QueryProcessorQueue168) TEIID30020 Processing exception for request /qqhN3vx+au1.0 'TEIID31118 Element "tdsa_vbl.t_code_translate."[value]"" is not defined by any relevant group.'. Originally QueryResolverException ResolverVisitor.java:106. Enable more detailed logging to see the entire stacktrace.
      21:19:40,897 WARN  [org.teiid.PROCESSOR] (Worker16_QueryProcessorQueue169) TEIID30020 Processing exception for request 1TAniWpe2wpN.0 'TEIID31119 Symbol "'value'" is specified with an unknown group context'. Originally QueryResolverException ResolverVisitor.java:106. Enable more detailed logging to see the entire stacktrace.
      21:19:52,600 WARN  [org.teiid.PROCESSOR] (Worker16_QueryProcessorQueue170) TEIID30020 Processing exception for request +8tCacHlFS8D.0 'TEIID31119 Symbol "value" is specified with an unknown group context'. Originally QueryResolverException ResolverVisitor.java:106. Enable more detailed logging to see the entire stacktrace.
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                sqtran Steve Tran
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: