clintropolis commented on code in PR #13799:
URL: https://github.com/apache/druid/pull/13799#discussion_r1119617731
##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java:
##########
@@ -3341,4 +3328,467 @@ public void testUnnestWithConstant()
)
);
}
+
+ @Test
+ public void testUnnestWithInFilterOnUnnestedCol()
+ {
+ skipVectorize();
+ cannotVectorize();
+ testQuery(
+ "SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested
(d3) where d3 IN ('a','b') ",
+ ImmutableList.of(
+ Druids.newScanQueryBuilder()
+ .dataSource(UnnestDataSource.create(
+ new TableDataSource(CalciteTests.DATASOURCE3),
+ "dim3",
+ "EXPR$0"
+ ))
+ .intervals(querySegmentSpec(Filtration.eternity()))
+
.resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST)
+ .legacy(false)
+ .context(QUERY_CONTEXT_DEFAULT)
+ .filters(new InDimFilter("EXPR$0", ImmutableList.of("a",
"b"), null))
+ .columns(ImmutableList.of(
+ "EXPR$0"
+ ))
+ .build()
+ ),
+
+ ImmutableList.of(
+ new Object[]{"a"},
+ new Object[]{"b"},
+ new Object[]{"b"}
+ )
+ );
+ }
+
+ @Test
+ public void testUnnestWithInFilterOnUnnestedColWhereFilterIsNotOnFirstValue()
+ {
+ skipVectorize();
+ cannotVectorize();
+ testQuery(
+ "SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested
(d3) where d3 IN ('d','c') ",
Review Comment:
oh, i got confused from all the repetitive patterns in this query, d3 isn't
dim3, another instance of me not being able to read :sob:
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]