imply-cheddar commented on code in PR #14531:
URL: https://github.com/apache/druid/pull/14531#discussion_r1255019239
##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteInsertDmlTest.java:
##########
@@ -1410,4 +1410,34 @@ public void testInsertWithSqlOuterLimit()
)
.verify();
}
+
+ @Test
+ public void testErrorWithUnableToConstructColumnSignatureWithExtern()
+ {
+ final String sqlString = "insert into dst \n"
+ + "select time_parse(\"time\") as __time, * \n"
+ + "from table( \n"
+ + "extern(\n"
+ + "'{\"type\": \"s3\", \"uris\":
[\\\"s3://imply-eng-datasets/qa/IngestionTest/wikipedia/files/wikiticker-2015-09-12-sampled.mini.json.gz\\\"]}',\n"
+ + "'{\"type\": \"json\"}',\n"
+ + "'[{\"name\": \"time\", \"type\": \"string\"},
{\"name\": \"channel\", \"type\": \"string\"}, {\"countryName\":
\"string\"}]'\n"
+ + ")\n"
+ + ")\n"
+ + "partitioned by DAY\n"
+ + "clustered by channel";
+ HashMap<String, Object> context = new HashMap<>(DEFAULT_CONTEXT);
+ context.put(PlannerContext.CTX_SQL_OUTER_LIMIT, 100);
+ testIngestionQuery().context(context).sql(sqlString)
+ .expectValidationError(
+ new DruidExceptionMatcher(
+ DruidException.Persona.USER,
+ DruidException.Category.INVALID_INPUT,
+ "general"
+ )
+ .expectMessageContains(
+ "Cannot construct instance of
`org.apache.druid.segment.column.ColumnSignature`, problem:
`java.lang.NullPointerException`\n"
Review Comment:
For this case specificaly, it would be great if the original `NPE` actually
carried with it an indication of which field it expected to exist. That is, we
likely need to get even deeper and make a better message for the NPE as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]