[
https://issues.apache.org/jira/browse/DRILL-3861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14936446#comment-14936446
]
Daniel Barclay (Drill) commented on DRILL-3861:
-----------------------------------------------
A scan of the code didn't reveal the source of the above problem, but did
reveal several cases of basically uncontrolled format strings and superfluous
formatting ({{format}}/{{fprintf}} calls with no substitutions):
In {{ExpressionInterpreterTest.showValueVectorContent}}:
{noformat}
System.out.printf(row + "th value: " + cellString + "\n");
{noformat}
In {{TestParquetWriter.runTestAndValidate}}:
{noformat}
String validateQuery = String.format("SELECT %s FROM " + outputFile,
validationSelection);
{noformat}
In {{TestAggregateFunctionsQuery.testDateAggFunction}}:
{noformat}
String result = String.format("MAX_DATE="+ t + "; " + "MIN_DATE=" + t1 +
"\n");
{noformat}
In {{TestCTAS.ctasPartitionWithEmptyList}}:
{noformat}
errorMsgTestHelper(ctasQuery,
String.format("PARSE ERROR: Encountered \"AS\""));
{noformat}
> Apparent uncontrolled format string error in table name error reporting
> -----------------------------------------------------------------------
>
> Key: DRILL-3861
> URL: https://issues.apache.org/jira/browse/DRILL-3861
> Project: Apache Drill
> Issue Type: Bug
> Components: SQL Parser
> Reporter: Daniel Barclay (Drill)
>
> It seems that a data string is being used as a printf format string.
> In the following, note the percent character in name of the table file (which
> does not exist, apparently trying to cause an expected no-such-table error)
> and that the actual error mentions format conversion characters:
> {noformat}
> 0: jdbc:drill:zk=local> select * from `test%percent.json`;
> Sep 29, 2015 2:59:37 PM org.apache.calcite.sql.validate.SqlValidatorException
> <init>
> SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Table
> 'test%percent.json' not found
> Sep 29, 2015 2:59:37 PM org.apache.calcite.runtime.CalciteException <init>
> SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1,
> column 15 to line 1, column 33: Table 'test%percent.json' not found
> Error: SYSTEM ERROR: UnknownFormatConversionException: Conversion = 'p'
> [Error Id: 8025e561-6ba1-4045-bbaa-a96cafc7f719 on dev-linux2:31010]
> (state=,code=0)
> 0: jdbc:drill:zk=local>
> {noformat}
> (Selecting SQL Parser component because I _think_ table/file existing is
> checked in validation called in or near the parsing step.)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)