[teiid-issues] [JBoss JIRA] (TEIID-3691) Add ability to set escape tokens within literals

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


    [ https://issues.jboss.org/browse/TEIID-3691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13107078#comment-13107078 ] 

Steven Hawkins commented on TEIID-3691:
---------------------------------------

If there are sources where string literals are not being translated correctly, then that should be an issue for the translators to be updated.  You have identified Impala.  It looks like Hive is the same way.

Otherwise, there shouldn't be a broader issue here.  Teiid user SQL follows ansi SQL.  If you want to have user sql with escaped literals, then there is the unescape Teiid system function.

> Add ability to set escape tokens within literals
> ------------------------------------------------
>
>                 Key: TEIID-3691
>                 URL: https://issues.jboss.org/browse/TEIID-3691
>             Project: Teiid
>          Issue Type: Bug
>          Components: Query Engine
>            Reporter: Don Krapohl
>            Assignee: Steven Hawkins
>
> 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.



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


More information about the teiid-issues mailing list