[teiid-issues] [JBoss JIRA] (TEIID-3692) Impala/Hive string literals

Steven Hawkins (JIRA) issues at jboss.org
Wed Sep 9 14:17:00 EDT 2015


     [ https://issues.jboss.org/browse/TEIID-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Hawkins updated TEIID-3692:
----------------------------------
           Component/s: Misc. Connectors
                            (was: Query Engine)
           Description: The Hive/Impala logic does not account for the source using c-style strings and will currently for string literals in the source sql use ansi style instead.  Bind values are unaffected.  (was: 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.)
         Fix Version/s: 8.12
    Steps to Reproduce:   (was: 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')


> Impala/Hive string literals
> ---------------------------
>
>                 Key: TEIID-3692
>                 URL: https://issues.jboss.org/browse/TEIID-3692
>             Project: Teiid
>          Issue Type: Bug
>          Components: Misc. Connectors
>            Reporter: Don Krapohl
>            Assignee: Steven Hawkins
>             Fix For: 8.12
>
>
> The Hive/Impala logic does not account for the source using c-style strings and will currently for string literals in the source sql use ansi style instead.  Bind values are unaffected.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list