clintropolis commented on a change in pull request #10613:
URL: https://github.com/apache/druid/pull/10613#discussion_r579010273
##########
File path: core/src/main/java/org/apache/druid/math/expr/IdentifierExpr.java
##########
@@ -149,13 +150,14 @@ public boolean canVectorize(InputBindingInspector
inspector)
ExprType inputType = inspector.getType(binding);
if (inputType == null) {
- // nil column, we can be anything, why not be a double
- return new IdentifierVectorProcessor<double[]>(ExprType.DOUBLE)
+ // nil column, we can be anything, so be a string because it's the most
flexible
+ // (numbers will be populated with default values in default mode and
non-null)
+ return new IdentifierVectorProcessor<String[]>(ExprType.STRING)
{
@Override
- public ExprEvalVector<double[]> evalVector(VectorInputBinding bindings)
+ public ExprEvalVector<String[]> evalVector(VectorInputBinding bindings)
{
- return new ExprEvalDoubleVector(bindings.getDoubleVector(binding),
bindings.getNullVector(binding));
+ return new
ExprEvalStringVector(Arrays.stream(bindings.getObjectVector(binding)).map(x ->
(String) x).toArray(String[]::new));
Review comment:
oops, i lied, it needs to cast because non-existent column gives back
`Object[]` of nulls instead of `String[]` of nulls
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]