You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ab...@apache.org on 2021/09/06 06:51:42 UTC
[druid] branch master updated: Add test for IS NOT NULL filter on
join column in left join (#11636)
This is an automated email from the ASF dual-hosted git repository.
abhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 60efbb5 Add test for IS NOT NULL filter on join column in left join (#11636)
60efbb5 is described below
commit 60efbb51d0282c1af9c132e7bd37a43e69867622
Author: Rohan Garg <77...@users.noreply.github.com>
AuthorDate: Mon Sep 6 12:20:41 2021 +0530
Add test for IS NOT NULL filter on join column in left join (#11636)
---
.../apache/druid/sql/calcite/CalciteQueryTest.java | 44 ++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
index 3afbbb7..7478988 100644
--- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
+++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
@@ -18254,6 +18254,50 @@ public class CalciteQueryTest extends BaseCalciteQueryTest
@Test
@Parameters(source = QueryContextForJoinProvider.class)
+ public void testLeftJoinWithNotNullFilter(Map<String, Object> queryContext) throws Exception
+ {
+ testQuery(
+ "SELECT s.dim1, t.dim1\n"
+ + "FROM foo as s\n"
+ + "LEFT JOIN foo as t "
+ + "ON s.dim1 = t.dim1 "
+ + "and s.dim1 IS NOT NULL\n",
+ queryContext,
+ ImmutableList.of(
+ newScanQueryBuilder()
+ .dataSource(
+ join(
+ new TableDataSource(CalciteTests.DATASOURCE1),
+ new QueryDataSource(newScanQueryBuilder()
+ .dataSource(CalciteTests.DATASOURCE1)
+ .intervals(querySegmentSpec(Filtration.eternity()))
+ .columns(ImmutableList.of("dim1"))
+ .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST)
+ .context(QUERY_CONTEXT_DEFAULT)
+ .build()),
+ "j0.",
+ equalsCondition(DruidExpression.fromColumn("dim1"), DruidExpression.fromColumn("j0.dim1")),
+ JoinType.LEFT
+ )
+ )
+ .intervals(querySegmentSpec(Filtration.eternity()))
+ .columns("dim1", "j0.dim1")
+ .context(queryContext)
+ .build()
+ ),
+ ImmutableList.of(
+ new Object[]{"", ""},
+ new Object[]{"10.1", "10.1"},
+ new Object[]{"2", "2"},
+ new Object[]{"1", "1"},
+ new Object[]{"def", "def"},
+ new Object[]{"abc", "abc"}
+ )
+ );
+ }
+
+ @Test
+ @Parameters(source = QueryContextForJoinProvider.class)
public void testInnerJoinSubqueryWithSelectorFilter(Map<String, Object> queryContext) throws Exception
{
// Cannot vectorize due to 'concat' expression.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org