Skip to content

Commit

Permalink
New test.
Browse files Browse the repository at this point in the history
  • Loading branch information
gianm committed May 10, 2024
1 parent 78358c2 commit 6674c35
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5955,6 +5955,40 @@ public void testNotInAndLessThanExpression()
);
}

@Test
public void testNotInOrEqualToOneOfThemExpression()
{
// Cannot vectorize scalar_in_array expression.
cannotVectorize();

testQuery(
"SELECT dim1 NOT IN ('abc', 'def', 'ghi') OR dim1 = 'def', COUNT(*)\n"
+ "FROM druid.foo\n"
+ "GROUP BY 1",
ImmutableList.of(
GroupByQuery.builder()
.setDataSource(CalciteTests.DATASOURCE1)
.setInterval(querySegmentSpec(Filtration.eternity()))
.setGranularity(Granularities.ALL)
.setVirtualColumns(
expressionVirtualColumn(
"v0",
"(! scalar_in_array(\"dim1\",array('abc','ghi')))",
ColumnType.LONG
)
)
.setDimensions(dimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.LONG)))
.setAggregatorSpecs(new CountAggregatorFactory("a0"))
.setContext(QUERY_CONTEXT_DEFAULT)
.build()
),
ImmutableList.of(
new Object[]{false, 1L},
new Object[]{true, 5L}
)
);
}

@Test
public void testSqlIsNullToInFilter()
{
Expand Down

0 comments on commit 6674c35

Please sign in to comment.