You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "James Turton (Jira)" <ji...@apache.org> on 2022/05/27 08:32:00 UTC

[jira] [Commented] (DRILL-8147) Drill fails to read files that begin with 'u' on Windows

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

James Turton commented on DRILL-8147:
-------------------------------------

Hi [~pseudomo], doubled backslashes will also work here. If we change to prevent the use of backslash as an escape character then users will no longer be able to enter paths containing backticks or Unicode chars that are not on their keyboards. Not that one would expect much of a need for that. [~cgivre], any thoughts about whether this should change or remain as it is?


{code:java}
SELECT * FROM dfs.`c:\\AnyFolder\\udontlikewindo.csv`;{code}

> Drill fails to read files that begin with 'u' on Windows
> --------------------------------------------------------
>
>                 Key: DRILL-8147
>                 URL: https://issues.apache.org/jira/browse/DRILL-8147
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - Text &amp; CSV
>            Reporter: pseudomo
>            Priority: Major
>
> It is very easy to reproduce on Windows.
> Just try to run this select. It is not necessary to actually have this folder of file.
> SELECT * FROM dfs.`c:\AnyFolder{*}\u{*}dontlikewindo.csv`;
> SQL Error: VALIDATION ERROR: Unable to parse unicode value: dont
> The workaround is to replace "\" with "/" which will work on Windows 10.
> Stack trace:
> {{Caused by: java.lang.IllegalArgumentException: Unable to parse unicode value: dont }}
> {{    at org.apache.commons.lang3.text.translate.UnicodeUnescaper.translate(UnicodeUnescaper.java:59) }}
> {{    at org.apache.commons.lang3.text.translate.AggregateTranslator.translate(AggregateTranslator.java:55) }}
> {{    at org.apache.commons.lang3.text.translate.CharSequenceTranslator.translate(CharSequenceTranslator.java:90) }}
> {{    at org.apache.commons.lang3.text.translate.CharSequenceTranslator.translate(CharSequenceTranslator.java:64) }}
> {{    at org.apache.commons.lang3.StringEscapeUtils.unescapeJava(StringEscapeUtils.java:526) }}
> {{    at org.apache.drill.common.util.DrillStringUtils.unescapeJava(DrillStringUtils.java:55) }}
> {{    at org.apache.drill.exec.store.dfs.FileSelection.create(FileSelection.java:277) }}
> {{    at org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema$FileSelectionInspector.getFileSelection(WorkspaceSchemaFactory.java:860) }}
> {{    at org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema$FileSelectionInspector.<init>(WorkspaceSchemaFactory.java:847) }}
> {{    at org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:600) }}
> {{    at org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:295) }}
> {{    at org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.getNewEntry(ExpandingConcurrentMap.java:96) }}
> {{    at org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.get(ExpandingConcurrentMap.java:90) }}
> {{    at org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.getTable(WorkspaceSchemaFactory.java:452) }}
> {{    at org.apache.drill.exec.store.dfs.FileSystemSchemaFactory$FileSystemSchema.getTable(FileSystemSchemaFactory.java:127) }}
> {{    at org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83) }}
> {{    at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:289) }}
> {{    at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143) }}
> {{    at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99) }}
> {{    at org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203) }}
> {{    at org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105) }}
> {{    at org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177) }}
> {{    at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1009) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:969) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3129) }}
> {{    at org.apache.drill.exec.planner.sql.conversion.DrillValidator.validateFrom(DrillValidator.java:80) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3111) }}
> {{    at org.apache.drill.exec.planner.sql.conversion.DrillValidator.validateFrom(DrillValidator.java:80) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3383) }}
> {{    at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) }}
> {{    at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1009) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:969) }}
> {{    at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:216) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:944) }}
> {{    at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:651) }}
> {{    at org.apache.drill.exec.planner.sql.conversion.SqlConverter.validate(SqlConverter.java:190) }}
> {{    at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode(DefaultSqlHandler.java:647) }}
> {{    at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert(DefaultSqlHandler.java:195) }}
> {{    at org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:169) }}
> {{    at org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan(DrillSqlWorker.java:283) }}
> {{    at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan(DrillSqlWorker.java:163) }}
> {{    at org.apache.drill.exec.planner.sql.DrillSqlWorker.convertPlan(DrillSqlWorker.java:140) }}
> {{    at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:93) }}
> {{    at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:593) }}
> {{    at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:274) }}
> {{    at .......(:0) }}
> {{Caused by: java.lang.NumberFormatException: For input string: "dont" under radix 16 }}
> {{    at .......(:0) }}
> {{    at org.apache.commons.lang3.text.translate.UnicodeUnescaper.translate(UnicodeUnescaper.java:56) }}
> {{    ... 47 more}}
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)