mirror of https://github.com/apache/druid.git
parent
e13d560b6e
commit
e36c46a85a
|
@ -25,7 +25,7 @@ public interface DruidConnectionExtras
|
|||
{
|
||||
ObjectMapper getObjectMapper();
|
||||
|
||||
public class DruidConnectionExtrasImpl implements DruidConnectionExtras
|
||||
class DruidConnectionExtrasImpl implements DruidConnectionExtras
|
||||
{
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
|
|
|
@ -94,7 +94,6 @@ import org.apache.druid.sql.calcite.util.CalciteTests;
|
|||
import org.joda.time.DateTimeZone;
|
||||
import org.joda.time.Period;
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.Assumptions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
|
@ -107,8 +106,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.Assume.assumeFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
||||
|
||||
public class CalciteJoinQueryTest extends BaseCalciteQueryTest
|
||||
{
|
||||
|
@ -3588,10 +3587,11 @@ public class CalciteJoinQueryTest extends BaseCalciteQueryTest
|
|||
{
|
||||
// JoinFilterAnalyzer bug causes incorrect results on this test in replace-with-default mode.
|
||||
// This test case was originally added in https://github.com/apache/druid/pull/11434 with a note about this.
|
||||
Assumptions.assumeFalse(NullHandling.replaceWithDefault() && QueryContext.of(queryContext).getEnableJoinFilterRewrite());
|
||||
assumeFalse(NullHandling.replaceWithDefault() && QueryContext.of(queryContext).getEnableJoinFilterRewrite());
|
||||
|
||||
assumeFalse(
|
||||
"join condition not support in decoupled mode", testBuilder().isDecoupledMode() && NullHandling.replaceWithDefault()
|
||||
testBuilder().isDecoupledMode() && NullHandling.replaceWithDefault(),
|
||||
"join condition not support in decoupled mode"
|
||||
);
|
||||
|
||||
// Cannot vectorize due to 'concat' expression.
|
||||
|
@ -4702,7 +4702,7 @@ public class CalciteJoinQueryTest extends BaseCalciteQueryTest
|
|||
cannotVectorize();
|
||||
|
||||
// We don't handle non-equi join conditions for non-sql compatible mode.
|
||||
Assumptions.assumeFalse(NullHandling.replaceWithDefault());
|
||||
assumeFalse(NullHandling.replaceWithDefault());
|
||||
|
||||
testQuery(
|
||||
"SELECT x.m1, y.m1 FROM foo x INNER JOIN foo y ON x.m1 > y.m1",
|
||||
|
@ -4765,7 +4765,7 @@ public class CalciteJoinQueryTest extends BaseCalciteQueryTest
|
|||
cannotVectorize();
|
||||
|
||||
// We don't handle non-equi join conditions for non-sql compatible mode.
|
||||
Assumptions.assumeFalse(NullHandling.replaceWithDefault());
|
||||
assumeFalse(NullHandling.replaceWithDefault());
|
||||
|
||||
testQuery(
|
||||
"SELECT x.m1, y.m1 FROM foo x INNER JOIN foo y ON x.m1 = y.m1 AND x.m1 + y.m1 = 6.0",
|
||||
|
@ -5653,7 +5653,7 @@ public class CalciteJoinQueryTest extends BaseCalciteQueryTest
|
|||
@ParameterizedTest(name = "{0}")
|
||||
public void testRegressionFilteredAggregatorsSubqueryJoins(Map<String, Object> queryContext)
|
||||
{
|
||||
assumeFalse("not support in decoupled mode", testBuilder().isDecoupledMode() && NullHandling.replaceWithDefault());
|
||||
assumeFalse(testBuilder().isDecoupledMode() && NullHandling.replaceWithDefault(), "not support in decoupled mode");
|
||||
|
||||
cannotVectorize();
|
||||
testQuery(
|
||||
|
|
|
@ -45,7 +45,7 @@ public class DecoupledExtension implements BeforeEachCallback
|
|||
private File qCaseDir;
|
||||
|
||||
@Override
|
||||
public void beforeEach(ExtensionContext context) throws Exception
|
||||
public void beforeEach(ExtensionContext context)
|
||||
{
|
||||
Class<?> testClass = context.getTestClass().get();
|
||||
qCaseDir = ProjectPathUtils.getPathFromProjectRoot("sql/src/test/quidem/" + testClass.getName());
|
||||
|
|
|
@ -43,7 +43,8 @@ public class QTestCase
|
|||
{
|
||||
this.testInfo = testInfo;
|
||||
sb = new StringBuffer();
|
||||
sb.append("# " + testInfo.comment);
|
||||
sb.append("# ");
|
||||
sb.append(testInfo.comment);
|
||||
sb.append("\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.google.common.cache.CacheBuilder;
|
|||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import org.apache.curator.shaded.com.google.common.collect.Sets;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.apache.druid.java.util.common.IAE;
|
||||
import org.apache.druid.java.util.common.StringUtils;
|
||||
import org.apache.druid.query.topn.TopNQueryConfig;
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
# testExactTopNOnInnerJoinWithLimit@NullHandling=sql case-crc:c3f897f8
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set useApproximateTopN false
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///?MinTopNThreshold=1
|
||||
select f1."dim4", sum("m1") from numfoo f1 inner join (
|
||||
select "dim4" from numfoo where dim4 <> 'a' group by 1
|
||||
) f2 on f1."dim4" = f2."dim4" group by 1 limit 1;
|
||||
+------+--------+
|
||||
| dim4 | EXPR$1 |
|
||||
+------+--------+
|
||||
| b | 15.0 |
|
||||
+------+--------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalSort(fetch=[1])
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[SUM($1)])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim4=[$4], m1=[$14])
|
||||
LogicalTableScan(table=[[druid, numfoo]])
|
||||
LogicalAggregate(group=[{4}])
|
||||
LogicalFilter(condition=[<>($4, 'a')])
|
||||
LogicalTableScan(table=[[druid, numfoo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidSort(fetch=[1], druid=[logical])
|
||||
DruidAggregate(group=[{0}], EXPR$1=[SUM($1)], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim4=[$4], m1=[$14], druid=[logical])
|
||||
DruidTableScan(table=[[druid, numfoo]], druid=[logical])
|
||||
DruidAggregate(group=[{4}], druid=[logical])
|
||||
DruidFilter(condition=[<>($4, 'a')])
|
||||
DruidTableScan(table=[[druid, numfoo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "topN",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "table",
|
||||
"name" : "numfoo"
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "numfoo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim4",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "a"
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim4",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"dim4\" == \"j0._d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"dimension" : {
|
||||
"type" : "default",
|
||||
"dimension" : "dim4",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
},
|
||||
"metric" : {
|
||||
"type" : "dimension",
|
||||
"ordering" : {
|
||||
"type" : "lexicographic"
|
||||
}
|
||||
},
|
||||
"threshold" : 1,
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"aggregations" : [ {
|
||||
"type" : "doubleSum",
|
||||
"name" : "a0",
|
||||
"fieldName" : "m1"
|
||||
} ]
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,165 @@
|
|||
# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql case-crc:7916e17e
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1
|
||||
;
|
||||
+------+
|
||||
| dim1 |
|
||||
+------+
|
||||
| 10.1 |
|
||||
+------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalAggregate(group=[{1}])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidAggregate(group=[{1}], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,165 @@
|
|||
# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql case-crc:a79ba14e
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1
|
||||
;
|
||||
+------+
|
||||
| dim1 |
|
||||
+------+
|
||||
| 10.1 |
|
||||
+------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalAggregate(group=[{1}])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidAggregate(group=[{1}], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,162 @@
|
|||
# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql case-crc:d168257e
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1
|
||||
;
|
||||
+------+
|
||||
| dim1 |
|
||||
+------+
|
||||
| 10.1 |
|
||||
+------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalAggregate(group=[{1}])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidAggregate(group=[{1}], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,165 @@
|
|||
# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql case-crc:dc96fa7f
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1
|
||||
;
|
||||
+------+
|
||||
| dim1 |
|
||||
+------+
|
||||
| 10.1 |
|
||||
+------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalAggregate(group=[{1}])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidAggregate(group=[{1}], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,165 @@
|
|||
# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql case-crc:7936703f
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1
|
||||
;
|
||||
+------+
|
||||
| dim1 |
|
||||
+------+
|
||||
| 10.1 |
|
||||
+------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalAggregate(group=[{1}])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidAggregate(group=[{1}], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,165 @@
|
|||
# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql case-crc:b5081d1c
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1
|
||||
;
|
||||
+------+
|
||||
| dim1 |
|
||||
+------+
|
||||
| 10.1 |
|
||||
+------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalAggregate(group=[{1}])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidAggregate(group=[{1}], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,165 @@
|
|||
# testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql case-crc:c0c596f8
|
||||
# quidem testcase reason: EQUIV_PLAN
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT dim1 from (SELECT dim1,__time FROM (SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1) GROUP BY 1,2) GROUP BY dim1
|
||||
;
|
||||
+------+
|
||||
| dim1 |
|
||||
+------+
|
||||
| 10.1 |
|
||||
+------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalAggregate(group=[{1}])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidAggregate(group=[{1}], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "_d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,90 @@
|
|||
# testInnerJoinCastLeft@all_disabled@NullHandling=sql case-crc:532afc53
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT foo.m1, l.k, l.v
|
||||
FROM foo
|
||||
INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k
|
||||
;
|
||||
+----+---+---+
|
||||
| m1 | k | v |
|
||||
+----+---+---+
|
||||
+----+---+---+
|
||||
(0 rows)
|
||||
|
||||
!ok
|
||||
LogicalProject(m1=[$0], k=[$2], v=[$3])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalTableScan(table=[[lookup, lookyloo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidTableScan(table=[[lookup, lookyloo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "CAST(\"m1\", 'STRING')",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "FLOAT", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "lookup",
|
||||
"lookup" : "lookyloo"
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.k\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "j0.k", "j0.v", "m1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING", "FLOAT" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,90 @@
|
|||
# testInnerJoinCastLeft@all_enabled@NullHandling=sql case-crc:615b6635
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT foo.m1, l.k, l.v
|
||||
FROM foo
|
||||
INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k
|
||||
;
|
||||
+----+---+---+
|
||||
| m1 | k | v |
|
||||
+----+---+---+
|
||||
+----+---+---+
|
||||
(0 rows)
|
||||
|
||||
!ok
|
||||
LogicalProject(m1=[$0], k=[$2], v=[$3])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalTableScan(table=[[lookup, lookyloo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidTableScan(table=[[lookup, lookyloo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "CAST(\"m1\", 'STRING')",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "FLOAT", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "lookup",
|
||||
"lookup" : "lookyloo"
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.k\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "j0.k", "j0.v", "m1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING", "FLOAT" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,87 @@
|
|||
# testInnerJoinCastLeft@default@NullHandling=sql case-crc:fda58dbf
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT foo.m1, l.k, l.v
|
||||
FROM foo
|
||||
INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k
|
||||
;
|
||||
+----+---+---+
|
||||
| m1 | k | v |
|
||||
+----+---+---+
|
||||
+----+---+---+
|
||||
(0 rows)
|
||||
|
||||
!ok
|
||||
LogicalProject(m1=[$0], k=[$2], v=[$3])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalTableScan(table=[[lookup, lookyloo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidTableScan(table=[[lookup, lookyloo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "CAST(\"m1\", 'STRING')",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "FLOAT", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "lookup",
|
||||
"lookup" : "lookyloo"
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.k\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "j0.k", "j0.v", "m1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING", "FLOAT" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,90 @@
|
|||
# testInnerJoinCastLeft@filter-on-value-column_disabled@NullHandling=sql case-crc:951d4374
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT foo.m1, l.k, l.v
|
||||
FROM foo
|
||||
INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k
|
||||
;
|
||||
+----+---+---+
|
||||
| m1 | k | v |
|
||||
+----+---+---+
|
||||
+----+---+---+
|
||||
(0 rows)
|
||||
|
||||
!ok
|
||||
LogicalProject(m1=[$0], k=[$2], v=[$3])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalTableScan(table=[[lookup, lookyloo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidTableScan(table=[[lookup, lookyloo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "CAST(\"m1\", 'STRING')",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "FLOAT", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "lookup",
|
||||
"lookup" : "lookyloo"
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.k\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "j0.k", "j0.v", "m1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING", "FLOAT" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,90 @@
|
|||
# testInnerJoinCastLeft@filter-rewrites-disabled@NullHandling=sql case-crc:403f05e1
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT foo.m1, l.k, l.v
|
||||
FROM foo
|
||||
INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k
|
||||
;
|
||||
+----+---+---+
|
||||
| m1 | k | v |
|
||||
+----+---+---+
|
||||
+----+---+---+
|
||||
(0 rows)
|
||||
|
||||
!ok
|
||||
LogicalProject(m1=[$0], k=[$2], v=[$3])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalTableScan(table=[[lookup, lookyloo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidTableScan(table=[[lookup, lookyloo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "CAST(\"m1\", 'STRING')",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "FLOAT", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "lookup",
|
||||
"lookup" : "lookyloo"
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.k\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "j0.k", "j0.v", "m1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING", "FLOAT" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,90 @@
|
|||
# testInnerJoinCastLeft@filter-rewrites@NullHandling=sql case-crc:9b73e9cb
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT foo.m1, l.k, l.v
|
||||
FROM foo
|
||||
INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k
|
||||
;
|
||||
+----+---+---+
|
||||
| m1 | k | v |
|
||||
+----+---+---+
|
||||
+----+---+---+
|
||||
(0 rows)
|
||||
|
||||
!ok
|
||||
LogicalProject(m1=[$0], k=[$2], v=[$3])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalTableScan(table=[[lookup, lookyloo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidTableScan(table=[[lookup, lookyloo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "CAST(\"m1\", 'STRING')",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "FLOAT", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "lookup",
|
||||
"lookup" : "lookyloo"
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.k\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "j0.k", "j0.v", "m1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING", "FLOAT" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,90 @@
|
|||
# testInnerJoinCastLeft@join-to-filter@NullHandling=sql case-crc:032c945b
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT foo.m1, l.k, l.v
|
||||
FROM foo
|
||||
INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k
|
||||
;
|
||||
+----+---+---+
|
||||
| m1 | k | v |
|
||||
+----+---+---+
|
||||
+----+---+---+
|
||||
(0 rows)
|
||||
|
||||
!ok
|
||||
LogicalProject(m1=[$0], k=[$2], v=[$3])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalTableScan(table=[[lookup, lookyloo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidTableScan(table=[[lookup, lookyloo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "CAST(\"m1\", 'STRING')",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "FLOAT", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "lookup",
|
||||
"lookup" : "lookyloo"
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.k\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "j0.k", "j0.v", "m1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING", "FLOAT" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:31aaba25
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:22a7ed95
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,132 @@
|
|||
# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql case-crc:fe77c11d
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:c115dcb0
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:466c2dda
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:8b226734
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:36ee0be3
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:0c7abe39
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:e167e948
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,132 @@
|
|||
# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql case-crc:ca2c56e9
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:012eaa97
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:39af5216
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:ec74956b
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:080e87b6
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[inner])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,156 @@
|
|||
# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql case-crc:a9e23ec5
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set defaultTimeout 300000
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set debug true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT CAST(__time AS BIGINT), m1, ANY_VALUE(dim3, 100) FROM foo WHERE (CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1, m1) IN
|
||||
(
|
||||
SELECT CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1 AS t1, MIN(m1) AS t2 FROM foo WHERE dim3 = 'b'
|
||||
AND __time BETWEEN '1994-04-29 00:00:00' AND '2020-01-11 00:00:00' GROUP BY 1
|
||||
)
|
||||
GROUP BY 1, 2
|
||||
;
|
||||
+--------------+-----+--------+
|
||||
| EXPR$0 | m1 | EXPR$2 |
|
||||
+--------------+-----+--------+
|
||||
| 946684800000 | 1.0 | [a, b] |
|
||||
| 946771200000 | 2.0 | [b, c] |
|
||||
+--------------+-----+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)])
|
||||
LogicalProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100])
|
||||
LogicalJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner])
|
||||
LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}], t2=[MIN($1)])
|
||||
LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5])
|
||||
LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical])
|
||||
DruidProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], druid=[logical])
|
||||
DruidJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner])
|
||||
DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical])
|
||||
DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "dim3", "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING", "FLOAT", "LONG" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1994-04-29T00:00:00.000Z/2020-01-11T00:00:00.001Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim3",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "b"
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "floatMin",
|
||||
"name" : "a0",
|
||||
"fieldName" : "m1"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "((\"v0\" == \"j0.d0\") && (\"m1\" == \"j0.a0\"))",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
}, {
|
||||
"type" : "default",
|
||||
"dimension" : "m1",
|
||||
"outputName" : "d1",
|
||||
"outputType" : "FLOAT"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "stringAny",
|
||||
"name" : "a0",
|
||||
"fieldName" : "dim3",
|
||||
"maxStringBytes" : 100,
|
||||
"aggregateMultipleValues" : true
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,156 @@
|
|||
# testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql case-crc:b873fcbb
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set defaultTimeout 300000
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set debug true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT CAST(__time AS BIGINT), m1, ANY_VALUE(dim3, 100, false) FROM foo WHERE (CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1, m1) IN
|
||||
(
|
||||
SELECT CAST(TIME_FLOOR(__time, 'PT1H') AS BIGINT) + 1 AS t1, MIN(m1) AS t2 FROM foo WHERE dim3 = 'b'
|
||||
AND __time BETWEEN '1994-04-29 00:00:00' AND '2020-01-11 00:00:00' GROUP BY 1
|
||||
)
|
||||
GROUP BY 1, 2
|
||||
;
|
||||
+--------------+-----+--------+
|
||||
| EXPR$0 | m1 | EXPR$2 |
|
||||
+--------------+-----+--------+
|
||||
| 946684800000 | 1.0 | a |
|
||||
| 946771200000 | 2.0 | b |
|
||||
+--------------+-----+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)])
|
||||
LogicalProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[false])
|
||||
LogicalJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner])
|
||||
LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}], t2=[MIN($1)])
|
||||
LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5])
|
||||
LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical])
|
||||
DruidProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[false], druid=[logical])
|
||||
DruidJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner])
|
||||
DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical])
|
||||
DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "dim3", "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING", "FLOAT", "LONG" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1994-04-29T00:00:00.000Z/2020-01-11T00:00:00.001Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "(timestamp_floor(\"__time\",'PT1H',null,'UTC') + 1)",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim3",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "b"
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "v0",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "floatMin",
|
||||
"name" : "a0",
|
||||
"fieldName" : "m1"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "((\"v0\" == \"j0.d0\") && (\"m1\" == \"j0.a0\"))",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
}, {
|
||||
"type" : "default",
|
||||
"dimension" : "m1",
|
||||
"outputName" : "d1",
|
||||
"outputType" : "FLOAT"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "stringAny",
|
||||
"name" : "a0",
|
||||
"fieldName" : "dim3",
|
||||
"maxStringBytes" : 100,
|
||||
"aggregateMultipleValues" : false
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,139 @@
|
|||
# testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql case-crc:76e87aaa
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set defaultTimeout 300000
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set debug true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT CAST(__time AS BIGINT), m1, ANY_VALUE(dim3, 100, true) FROM foo WHERE (TIME_FLOOR(__time, 'PT1H'), m1) IN
|
||||
(
|
||||
SELECT TIME_FLOOR(__time, 'PT1H') AS t1, MIN(m1) AS t2 FROM foo WHERE dim3 = 'b'
|
||||
AND __time BETWEEN '1994-04-29 00:00:00' AND '2020-01-11 00:00:00' GROUP BY 1
|
||||
)
|
||||
GROUP BY 1, 2
|
||||
;
|
||||
+--------------+-----+--------+
|
||||
| EXPR$0 | m1 | EXPR$2 |
|
||||
+--------------+-----+--------+
|
||||
| 946684800000 | 1.0 | [a, b] |
|
||||
| 946771200000 | 2.0 | [b, c] |
|
||||
+--------------+-----+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)])
|
||||
LogicalProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[true])
|
||||
LogicalJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner])
|
||||
LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}], t2=[MIN($1)])
|
||||
LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5])
|
||||
LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical])
|
||||
DruidProject(EXPR$0=[CAST($0):BIGINT NOT NULL], m1=[$2], dim3=[$1], $f3=[100], $f4=[true], druid=[logical])
|
||||
DruidJoin(condition=[AND(=($3, $4), =($2, $5))], joinType=[inner])
|
||||
DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical])
|
||||
DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "dim3", "m1", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING", "FLOAT", "LONG" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "timeseries",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1994-04-29T00:00:00.000Z/2020-01-11T00:00:00.001Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim3",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "b"
|
||||
},
|
||||
"granularity" : "HOUR",
|
||||
"aggregations" : [ {
|
||||
"type" : "floatMin",
|
||||
"name" : "a0",
|
||||
"fieldName" : "m1"
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "((\"v0\" == \"j0.d0\") && (\"m1\" == \"j0.a0\"))",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "__time",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "LONG"
|
||||
}, {
|
||||
"type" : "default",
|
||||
"dimension" : "m1",
|
||||
"outputName" : "d1",
|
||||
"outputType" : "FLOAT"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "stringAny",
|
||||
"name" : "a0",
|
||||
"fieldName" : "dim3",
|
||||
"maxStringBytes" : 100,
|
||||
"aggregateMultipleValues" : true
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,186 @@
|
|||
# testJoinWithInputRefCondition@NullHandling=sql case-crc:a8c0f240
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) FROM foo;
|
||||
+--------+
|
||||
| EXPR$0 |
|
||||
+--------+
|
||||
| 6 |
|
||||
+--------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0])
|
||||
LogicalProject($f0=[OR(=($1, 0), AND(IS NULL($4), >=($2, $1)))])
|
||||
LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $3)], joinType=[left])
|
||||
LogicalJoin(condition=[true], joinType=[inner])
|
||||
LogicalProject(DUMMY=[0])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{5}], i=[LITERAL_AGG(true)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical])
|
||||
DruidProject($f0=[OR(=($1, 0), AND(IS NULL($4), >=($2, $1)))], druid=[logical])
|
||||
DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $3)], joinType=[left])
|
||||
DruidJoin(condition=[true], joinType=[inner])
|
||||
DruidProject(DUMMY=[0], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{5}], i=[LITERAL_AGG(true)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "timeseries",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "0",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "timeseries",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
}, {
|
||||
"type" : "filtered",
|
||||
"aggregator" : {
|
||||
"type" : "count",
|
||||
"name" : "a1"
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "null",
|
||||
"column" : "m1"
|
||||
}
|
||||
},
|
||||
"name" : "a1"
|
||||
} ]
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "1",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "m1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "FLOAT"
|
||||
} ],
|
||||
"postAggregations" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "a0",
|
||||
"expression" : "1",
|
||||
"outputType" : "LONG"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "_j0.",
|
||||
"condition" : "(CAST(floor(100), 'DOUBLE') == \"_j0.d0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"aggregations" : [ {
|
||||
"type" : "filtered",
|
||||
"aggregator" : {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "or",
|
||||
"fields" : [ {
|
||||
"type" : "equals",
|
||||
"column" : "j0.a0",
|
||||
"matchValueType" : "LONG",
|
||||
"matchValue" : 0
|
||||
}, {
|
||||
"type" : "and",
|
||||
"fields" : [ {
|
||||
"type" : "null",
|
||||
"column" : "_j0.a0"
|
||||
}, {
|
||||
"type" : "expression",
|
||||
"expression" : "(\"j0.a1\" >= \"j0.a0\")"
|
||||
} ]
|
||||
} ]
|
||||
},
|
||||
"name" : "a0"
|
||||
} ]
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:5934672b
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:2305f2ac
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,132 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql case-crc:fb3f7888
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:914692f2
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:8033cbb3
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:82d2e4f7
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:6381fa96
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,141 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:5df88307
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.v0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,141 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:e1a970a4
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.v0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,138 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql case-crc:235e0aba
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.v0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,141 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:46643c1d
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.v0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,141 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:fe4a2072
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.v0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,141 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:a5ec6a25
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.v0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,141 @@
|
|||
# testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:78302b3a
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' AND "__time" >= '1999'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1 WHERE t1.dim1 = '10.1'
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR])
|
||||
LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical])
|
||||
DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "1999-01-01T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.v0\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql case-crc:f40ac966
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql case-crc:b06e5180
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,132 @@
|
|||
# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql case-crc:113b89ee
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql case-crc:1c4df7a3
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql case-crc:c8b860e5
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql case-crc:47dc2525
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,135 @@
|
|||
# testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql case-crc:28f1233a
|
||||
# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set enableJoinLeftTableScanDirect true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
with abc as
|
||||
(
|
||||
SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1'
|
||||
)
|
||||
SELECT t1.dim1, t1."__time" from abc as t1 LEFT JOIN abc as t2 on t1.dim1 = t2.dim1
|
||||
;
|
||||
+------+---------------------+
|
||||
| dim1 | __time |
|
||||
+------+---------------------+
|
||||
| 10.1 | 2000-01-02 00:00:00 |
|
||||
+------+---------------------+
|
||||
(1 row)
|
||||
|
||||
!ok
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1])
|
||||
LogicalJoin(condition=[=($0, $2)], joinType=[left])
|
||||
LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalProject(dim1=[$1])
|
||||
LogicalFilter(condition=[=($1, '10.1')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical])
|
||||
DruidJoin(condition=[=($0, $2)], joinType=[left])
|
||||
DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidProject(dim1=[$1], druid=[logical])
|
||||
DruidFilter(condition=[=($1, '10.1')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "__time", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"resultFormat" : "compactedList",
|
||||
"filter" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : "10.1"
|
||||
},
|
||||
"columns" : [ "dim1" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.dim1\")",
|
||||
"joinType" : "LEFT"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "_v0",
|
||||
"expression" : "'10.1'",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "__time", "_v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "LONG", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,140 @@
|
|||
# testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql case-crc:f2ca92ca
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2;
|
||||
+------+--------+
|
||||
| dim2 | EXPR$1 |
|
||||
+------+--------+
|
||||
| a | 2 |
|
||||
| abc | 1 |
|
||||
+------+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[COUNT()])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)])
|
||||
LogicalFilter(condition=[<>($1, '')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical])
|
||||
DruidFilter(condition=[<>($1, '')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "substring(\"dim2\", 0, 1)",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "dim2", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : ""
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "extraction",
|
||||
"dimension" : "dim1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING",
|
||||
"extractionFn" : {
|
||||
"type" : "substring",
|
||||
"index" : 0,
|
||||
"length" : 1
|
||||
}
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim2",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,140 @@
|
|||
# testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql case-crc:2261e315
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2;
|
||||
+------+--------+
|
||||
| dim2 | EXPR$1 |
|
||||
+------+--------+
|
||||
| a | 2 |
|
||||
| abc | 1 |
|
||||
+------+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[COUNT()])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)])
|
||||
LogicalFilter(condition=[<>($1, '')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical])
|
||||
DruidFilter(condition=[<>($1, '')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "substring(\"dim2\", 0, 1)",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "dim2", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : ""
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "extraction",
|
||||
"dimension" : "dim1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING",
|
||||
"extractionFn" : {
|
||||
"type" : "substring",
|
||||
"index" : 0,
|
||||
"length" : 1
|
||||
}
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim2",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,137 @@
|
|||
# testUsingSubqueryWithExtractionFns@default@NullHandling=sql case-crc:e8b174d8
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2;
|
||||
+------+--------+
|
||||
| dim2 | EXPR$1 |
|
||||
+------+--------+
|
||||
| a | 2 |
|
||||
| abc | 1 |
|
||||
+------+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[COUNT()])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)])
|
||||
LogicalFilter(condition=[<>($1, '')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical])
|
||||
DruidFilter(condition=[<>($1, '')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "substring(\"dim2\", 0, 1)",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "dim2", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : ""
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "extraction",
|
||||
"dimension" : "dim1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING",
|
||||
"extractionFn" : {
|
||||
"type" : "substring",
|
||||
"index" : 0,
|
||||
"length" : 1
|
||||
}
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim2",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,140 @@
|
|||
# testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql case-crc:c71da62e
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2;
|
||||
+------+--------+
|
||||
| dim2 | EXPR$1 |
|
||||
+------+--------+
|
||||
| a | 2 |
|
||||
| abc | 1 |
|
||||
+------+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[COUNT()])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)])
|
||||
LogicalFilter(condition=[<>($1, '')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical])
|
||||
DruidFilter(condition=[<>($1, '')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "substring(\"dim2\", 0, 1)",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "dim2", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : ""
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "extraction",
|
||||
"dimension" : "dim1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING",
|
||||
"extractionFn" : {
|
||||
"type" : "substring",
|
||||
"index" : 0,
|
||||
"length" : 1
|
||||
}
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim2",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,140 @@
|
|||
# testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql case-crc:ea2bb732
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2;
|
||||
+------+--------+
|
||||
| dim2 | EXPR$1 |
|
||||
+------+--------+
|
||||
| a | 2 |
|
||||
| abc | 1 |
|
||||
+------+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[COUNT()])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)])
|
||||
LogicalFilter(condition=[<>($1, '')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical])
|
||||
DruidFilter(condition=[<>($1, '')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "substring(\"dim2\", 0, 1)",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "dim2", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : ""
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "extraction",
|
||||
"dimension" : "dim1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING",
|
||||
"extractionFn" : {
|
||||
"type" : "substring",
|
||||
"index" : 0,
|
||||
"length" : 1
|
||||
}
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim2",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,140 @@
|
|||
# testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql case-crc:7443f782
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters true
|
||||
!set enableRewriteJoinToFilter false
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite true
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2;
|
||||
+------+--------+
|
||||
| dim2 | EXPR$1 |
|
||||
+------+--------+
|
||||
| a | 2 |
|
||||
| abc | 1 |
|
||||
+------+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[COUNT()])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)])
|
||||
LogicalFilter(condition=[<>($1, '')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical])
|
||||
DruidFilter(condition=[<>($1, '')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "substring(\"dim2\", 0, 1)",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "dim2", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : ""
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "extraction",
|
||||
"dimension" : "dim1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING",
|
||||
"extractionFn" : {
|
||||
"type" : "substring",
|
||||
"index" : 0,
|
||||
"length" : 1
|
||||
}
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim2",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
|
@ -0,0 +1,140 @@
|
|||
# testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql case-crc:6178ece2
|
||||
# quidem testcase reason: JOIN_FILTER_LOCATIONS
|
||||
!set sqlQueryId dummy
|
||||
!set defaultTimeout 300000
|
||||
!set debug true
|
||||
!set maxScatterGatherBytes 9223372036854775807
|
||||
!set enableJoinFilterRewriteValueColumnFilters false
|
||||
!set enableRewriteJoinToFilter true
|
||||
!set sqlCurrentTimestamp 2000-01-01T00:00:00Z
|
||||
!set plannerStrategy DECOUPLED
|
||||
!set enableJoinFilterRewrite false
|
||||
!set outputformat mysql
|
||||
!use druidtest:///
|
||||
SELECT dim2, COUNT(*) FROM druid.foo WHERE substring(dim2, 1, 1) IN (SELECT substring(dim1, 1, 1) FROM druid.foo WHERE dim1 <> '')group by dim2;
|
||||
+------+--------+
|
||||
| dim2 | EXPR$1 |
|
||||
+------+--------+
|
||||
| a | 2 |
|
||||
| abc | 1 |
|
||||
+------+--------+
|
||||
(2 rows)
|
||||
|
||||
!ok
|
||||
LogicalAggregate(group=[{0}], EXPR$1=[COUNT()])
|
||||
LogicalJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
LogicalAggregate(group=[{0}])
|
||||
LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)])
|
||||
LogicalFilter(condition=[<>($1, '')])
|
||||
LogicalTableScan(table=[[druid, foo]])
|
||||
|
||||
!logicalPlan
|
||||
DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical])
|
||||
DruidJoin(condition=[=($1, $2)], joinType=[inner])
|
||||
DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
DruidAggregate(group=[{0}], druid=[logical])
|
||||
DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical])
|
||||
DruidFilter(condition=[<>($1, '')])
|
||||
DruidTableScan(table=[[druid, foo]], druid=[logical])
|
||||
|
||||
!druidPlan
|
||||
{
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "join",
|
||||
"left" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "scan",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"virtualColumns" : [ {
|
||||
"type" : "expression",
|
||||
"name" : "v0",
|
||||
"expression" : "substring(\"dim2\", 0, 1)",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"resultFormat" : "compactedList",
|
||||
"columns" : [ "dim2", "v0" ],
|
||||
"legacy" : false,
|
||||
"columnTypes" : [ "STRING", "STRING" ],
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"right" : {
|
||||
"type" : "query",
|
||||
"query" : {
|
||||
"queryType" : "groupBy",
|
||||
"dataSource" : {
|
||||
"type" : "table",
|
||||
"name" : "foo"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"filter" : {
|
||||
"type" : "not",
|
||||
"field" : {
|
||||
"type" : "equals",
|
||||
"column" : "dim1",
|
||||
"matchValueType" : "STRING",
|
||||
"matchValue" : ""
|
||||
}
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "extraction",
|
||||
"dimension" : "dim1",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING",
|
||||
"extractionFn" : {
|
||||
"type" : "substring",
|
||||
"index" : 0,
|
||||
"length" : 1
|
||||
}
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rightPrefix" : "j0.",
|
||||
"condition" : "(\"v0\" == \"j0.d0\")",
|
||||
"joinType" : "INNER"
|
||||
},
|
||||
"intervals" : {
|
||||
"type" : "intervals",
|
||||
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
|
||||
},
|
||||
"granularity" : {
|
||||
"type" : "all"
|
||||
},
|
||||
"dimensions" : [ {
|
||||
"type" : "default",
|
||||
"dimension" : "dim2",
|
||||
"outputName" : "d0",
|
||||
"outputType" : "STRING"
|
||||
} ],
|
||||
"aggregations" : [ {
|
||||
"type" : "count",
|
||||
"name" : "a0"
|
||||
} ],
|
||||
"limitSpec" : {
|
||||
"type" : "NoopLimitSpec"
|
||||
}
|
||||
}
|
||||
!nativePlan
|
Loading…
Reference in New Issue