Paul Rogers created DRILL-5930: ---------------------------------- Summary: 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)