Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove istrue, isfalse vectorized impls. #14991

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions processing/src/main/java/org/apache/druid/math/expr/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.druid.java.util.common.UOE;
import org.apache.druid.math.expr.vector.CastToTypeVectorProcessor;
import org.apache.druid.math.expr.vector.ExprVectorProcessor;
import org.apache.druid.math.expr.vector.VectorComparisonProcessors;
import org.apache.druid.math.expr.vector.VectorMathProcessors;
import org.apache.druid.math.expr.vector.VectorProcessors;
import org.apache.druid.math.expr.vector.VectorStringProcessors;
Expand Down Expand Up @@ -2319,19 +2318,6 @@ public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List<E
{
return ExpressionType.LONG;
}

@Override
public boolean canVectorize(Expr.InputBindingInspector inspector, List<Expr> args)
{
final Expr expr = args.get(0);
return inspector.areNumeric(expr) && expr.canVectorize(inspector);
}

@Override
public <T> ExprVectorProcessor<T> asVectorProcessor(Expr.VectorInputBindingInspector inspector, List<Expr> args)
{
return VectorComparisonProcessors.lessThanOrEqual(inspector, args.get(0), ExprEval.of(0L).toExpr());
}
}

/**
Expand Down Expand Up @@ -2364,19 +2350,6 @@ public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List<E
{
return ExpressionType.LONG;
}

@Override
public boolean canVectorize(Expr.InputBindingInspector inspector, List<Expr> args)
{
final Expr expr = args.get(0);
return inspector.areNumeric(expr) && expr.canVectorize(inspector);
}

@Override
public <T> ExprVectorProcessor<T> asVectorProcessor(Expr.VectorInputBindingInspector inspector, List<Expr> args)
{
return VectorComparisonProcessors.greaterThan(inspector, args.get(0), ExprEval.of(0L).toExpr());
}
}

class IsNullFunc implements Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,12 @@ public void testExactCountDistinctWithFilter()
);

requireMergeBuffers(3);

if (NullHandling.sqlCompatible()) {
// Cannot vectorize due to "istrue" operator.
cannotVectorize();
}

testQuery(
PLANNER_CONFIG_NO_HLL.withOverrides(
ImmutableMap.of(
Expand All @@ -2459,9 +2465,9 @@ public void testExactCountDistinctWithFilter()
.setGranularity(Granularities.ALL)
.setVirtualColumns(expressionVirtualColumn(
"v0",
NullHandling.replaceWithDefault()
? "(\"cnt\" == 1)"
: "istrue((\"cnt\" == 1))",
NullHandling.sqlCompatible()
? "istrue((\"cnt\" == 1))"
: "(\"cnt\" == 1)",
ColumnType.LONG
))
.setDimensions(dimensions(
Expand Down