mirror of https://github.com/apache/druid.git
Better error message when theta_sketch_intersect is used on scalar expression (#13508)
This commit is contained in:
parent
37d8833125
commit
b25cf216d5
|
@ -63,6 +63,8 @@ public abstract class ThetaSketchSetBaseOperatorConversion implements SqlOperato
|
||||||
RexNode rexNode
|
RexNode rexNode
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
plannerContext.setPlanningError("%s can only be used on aggregates. " +
|
||||||
|
"It cannot be used directly on a column or on a scalar expression.", getFunctionName());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1014,4 +1014,12 @@ public class ThetaSketchSqlAggregatorTest extends BaseCalciteQueryTest
|
||||||
ImmutableList.of(new Object[]{"a", 0L, 0L, "0.0", "0.0"})
|
ImmutableList.of(new Object[]{"a", 0L, 0L, "0.0", "0.0"})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testThetaSketchIntersectOnScalarExpression()
|
||||||
|
{
|
||||||
|
assertQueryIsUnplannable("SELECT THETA_SKETCH_INTERSECT(NULL, NULL) FROM foo",
|
||||||
|
"Possible error: THETA_SKETCH_INTERSECT can only be used on aggregates. " +
|
||||||
|
"It cannot be used directly on a column or on a scalar expression.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue