diff --git a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/EmbedExpression.java b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/EmbedExpression.java index a0bbad879d1..e62aac1e52d 100644 --- a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/EmbedExpression.java +++ b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/EmbedExpression.java @@ -64,12 +64,13 @@ else if ( ! embedders.containsKey(embedderId)) { } @Override - public DataType setInputType(DataType type, VerificationContext context) { - super.setInputType(type, context); - if ( ! (type == DataType.STRING) && - ! (type instanceof ArrayDataType array && array.getNestedType() == DataType.STRING)) + public DataType setInputType(DataType inputType, VerificationContext context) { + super.setInputType(inputType, context); + if ( inputType != null && + ! (inputType == DataType.STRING) && + ! (inputType instanceof ArrayDataType array && array.getNestedType() == DataType.STRING)) throw new VerificationException(this, "This requires either a string or array input type, but got " + - type.getName()); + inputType.getName()); return getOutputType(context); // embed cannot determine the output type from the input } diff --git a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/PackBitsExpression.java b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/PackBitsExpression.java index a51b69ec7a4..66602c40355 100644 --- a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/PackBitsExpression.java +++ b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/PackBitsExpression.java @@ -23,6 +23,7 @@ public class PackBitsExpression extends Expression { @Override public DataType setInputType(DataType inputType, VerificationContext context) { + if (inputType == null) return null; super.setInputType(inputType, context); if ( ! validType(inputType)) throw new VerificationException(this, "Require a tensor with one dense dimension, but got " + inputType.getName());