abhishekagarwal87 commented on code in PR #14483:
URL: https://github.com/apache/druid/pull/14483#discussion_r1240617642
##########
sql/src/test/java/org/apache/druid/sql/calcite/run/SqlResultsTest.java:
##########
@@ -102,6 +104,20 @@ public void testCoerceNestedArrays()
assertCoerced(nestedList, nestedArray, true);
}
+ @Test
+ public void testCoerceOfArrayOfPrimitives()
+ {
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+ SqlResults.coerce(mapper, new SqlResults.Context(null, false, false),
new byte[0],
+ SqlTypeName.BIGINT, "testFieldName"
+ );
+ Assert.fail("Should throw an exception");
+ }
+ catch (Exception e) {
+ Assert.assertEquals("Cannot coerce field [testFieldName] of value with
class [[B] to BIGINT", e.getMessage());
Review Comment:
can we also more friendly type names such as `binary` instead of `[[B`?
--
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]