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

Add ability to set escape tokens within literals

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • Query Engine
    • None
    • Hide

      Using the generalized schema-
      create table myTable (customerName string)

      Issue the following query to any jdbc/odbc database connection with C-type literal quote escapes (such as Hive):

      SELECT 1 FROM myTable WHERE customerName = 'Haggley''s'

      Expected result is no row (we didn't insert data)
      Actual result is a parser error passed back up from the database because it expects single quotes escaped as in 'Haggley\'s'

      Show
      Using the generalized schema- create table myTable (customerName string) Issue the following query to any jdbc/odbc database connection with C-type literal quote escapes (such as Hive): SELECT 1 FROM myTable WHERE customerName = 'Haggley''s' Expected result is no row (we didn't insert data) Actual result is a parser error passed back up from the database because it expects single quotes escaped as in 'Haggley\'s'

      A mismatch of escape sequences exists between Teiid and some databases (Impala for sure). Teiid uses doubled up quotes for single/double whereas some databases expect C-style escapes like \' or \". When string literals are pushed down they fail to parse on the underlying database using Teiid's escapes.

      Teiid uses multiple quotes to escape a single within a string literal. Example would be searching for the string literal Haggley's within single quotes. In Teiid the parser will fail with a parser error using any of these options:

      • Surround with double quotes ("Haggley's")
      • Escape with C-style escape ('Haggley\'s')

      Making the query parse in Teiid the filter value would be 'Haggley''s'. When pushed down into the database this is not valid syntax and should be translated as 'Haggley\'s' or other escape sequence as appropriate to the underlying data store.

              rhn-engineering-shawkins Steven Hawkins
              dkrapohl@hotmail.com Donald Krapohl (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: