You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Arina Ielchiieva (JIRA)" <ji...@apache.org> on 2017/11/04 15:48:00 UTC

[jira] [Commented] (DRILL-5930) Table function escape handling does not handle lone backslash

    [ https://issues.apache.org/jira/browse/DRILL-5930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16239064#comment-16239064 ] 

Arina Ielchiieva commented on DRILL-5930:
-----------------------------------------

{{StringEscapeUtils.unescapeJava(param)}} was initially used to treat {{\n}} and similar as new line rather then two chars.

> Table function escape handling does not handle lone backslash
> -------------------------------------------------------------
>
>                 Key: DRILL-5930
>                 URL: https://issues.apache.org/jira/browse/DRILL-5930
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.11.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>
> Consider the following query from the test framework ({{Functional/table_function/positive/drill-3149_10.q}}):
> {code}
> select * from table(`table_function/colons.txt`(type=>'text',lineDelimiter=>'\\'))
> {code}
> Notice the double-backslash. Drill translates this into a single backslash. But, what happens if the user provides just a single backslash? Drill translates that into the empty string. Drill passes the empty string to the text reader, which fails with the error described in DRILL-5929.
> Better would be to either:
> * Leave lone back-slashes unchanged, or
> * Fail a query with an lone backslash.
> The fix for this bug prefers the first (because it is easiest.) However, this fix does not handle a triple backslash, which will be translated to a single backslash:
> * \ \ --> \
> * \ --> (nothing)
> The code in question:
> {code}
> class FormatPluginOp ...
>   FormatPluginConfig createConfigForTable(TableInstance t) {
> ...
>           param = StringEscapeUtils.unescapeJava(param);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)