[
https://issues.apache.org/jira/browse/DRILL-6878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16718281#comment-16718281
]
ASF GitHub Bot commented on DRILL-6878:
---------------------------------------
gparai commented on a change in pull request #1568: DRILL-6878: Use
DrillPushRowKeyJoinToScan rule on DrillJoin pattern to o account for
DrillSemiJoin
URL: https://github.com/apache/drill/pull/1568#discussion_r240845722
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/RowKeyJoinRel.java
##########
@@ -50,20 +66,72 @@ public RowKeyJoinRel(RelOptCluster cluster, RelTraitSet
traits, RelNode left, Re
@Override
public RowKeyJoinRel copy(RelTraitSet traitSet, RexNode condition, RelNode
left, RelNode right, JoinRelType joinType,
- boolean semiJoinDone) {
- return new RowKeyJoinRel(getCluster(), traitSet, left, right, condition,
joinType);
+ boolean semiJoin) {
+ return new RowKeyJoinRel(getCluster(), traitSet, left, right, condition,
joinType, semiJoin);
}
@Override
public LogicalOperator implement(DrillImplementor implementor) {
return super.implement(implementor);
}
+ /**
+ * Returns whether this RowKeyJoin represents a {@link
org.apache.calcite.rel.core.SemiJoin}
+ * @return true if join represents a {@link
org.apache.calcite.rel.core.SemiJoin}, false otherwise.
+ */
+ public boolean isSemiJoin() {
+ return isSemiJoin;
+ }
+
+ @Override
+ public RelDataType deriveRowType() {
+ return SqlValidatorUtil.deriveJoinRowType(
+ left.getRowType(),
+ isSemiJoin() ? null : right.getRowType(),
+ JoinRelType.INNER,
+ getCluster().getTypeFactory(),
+ null,
+ ImmutableList.of());
+ }
+
public static RowKeyJoinRel convert(Join join, ConversionContext context)
throws InvalidRelException {
Pair<RelNode, RelNode> inputs = getJoinInputs(join, context);
RexNode rexCondition = getJoinCondition(join, context);
RowKeyJoinRel joinRel = new RowKeyJoinRel(context.getCluster(),
context.getLogicalTraits(),
inputs.left, inputs.right, rexCondition, join.getJoinType());
return joinRel;
}
+
+ @Override public boolean isValid(Litmus litmus, Context context) {
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Index Plan Test failures after DRILL-6833
> -----------------------------------------
>
> Key: DRILL-6878
> URL: https://issues.apache.org/jira/browse/DRILL-6878
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.15.0
> Reporter: Gautam Parai
> Assignee: Gautam Parai
> Priority: Blocker
> Fix For: 1.15.0
>
>
> [ERROR] Failures:
> [ERROR] IndexPlanTest.testCastTimestampPlan:1148 Incorrect number of rows
> returned by query. expected:<1> but was:<0>
> [ERROR] IndexPlanTest.testRowkeyJoinPushdown_1:1702 Did not find expected
> pattern in plan: RowKeyJoin
> 00-00 Screen
> 00-01 Project(ssn=[$0])
> 00-02 Project(ssn=[$1])
> 00-03 HashJoin(condition=[=($0, $2)], joinType=[inner], semi-join: =[true])
> 00-05 Project(_id=[$0], ITEM=[ITEM($1, 'ssn')])
> 00-06 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=null], columns=[`_id`, `id`.`ssn`], maxwidth=2]])
> 00-04 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=($0 =
> {"$date":"2013-02-04T22:34:38.000Z"}
> ), indexName=hash_i_cast_timestamp_firstlogin], columns=[`_id`],
> maxwidth=10]])
> [ERROR] IndexPlanTest.testRowkeyJoinPushdown_10:1883 Incorrect number of rows
> returned by query. expected:<1> but was:<0>
> [ERROR] IndexPlanTest.testRowkeyJoinPushdown_12:1918 Did not find expected
> pattern in plan: HashJoin(.*[
> ])+.*Scan.*indexName=i_state_city_dl(.*[
> ])+.*RowKeyJoin(.*[
> ])+.*RestrictedJsonTableGroupScan(.*[
> ])+.*HashAgg(group=[\{0}])(.*[
> ])+.*HashJoin
> 00-00 Screen
> 00-01 Project(ssn=[$0])
> 00-02 Project(ssn=[$1])
> 00-03 HashJoin(condition=[=($0, $5)], joinType=[inner], semi-join: =[true])
> 00-05 HashJoin(condition=[=($2, $3)], joinType=[inner], semi-join: =[false])
> 00-08 Project(_id=[$0], ITEM=[ITEM($1, 'ssn')], ITEM2=[ITEM($2, 'city')])
> 00-11 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=null], columns=[`_id`, `id`.`ssn`, `address`.`city`], maxwidth=2]])
> 00-07 Project(ITEM0=[$0], ITEM1=[$1])
> 00-10 Project(ITEM=[ITEM($0, 'city')], ITEM1=[ITEM($0, 'state')])
> 00-14 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=(address.state = "pc"), indexName=i_state_city_dl],
> columns=[`address`.`city`, `address`.`state`], maxwidth=1]])
> 00-04 Project(EXPR$0=[CAST(CAST($0):INTEGER):VARCHAR(10) CHARACTER SET
> "UTF-16LE" COLLATE "UTF-16LE$en_US$primary"])
> 00-06 Project(rowid=[$1], ITEM=[$2], ITEM2=[$3], ITEM0=[$0])
> 00-09 HashJoin(condition=[=($2, $0)], joinType=[inner], semi-join: =[false])
> 00-13 Project(ITEM=[ITEM($0, 'city')])
> 00-16 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=null], columns=[`address`.`city`], maxwidth=2]])
> 00-12 Project(rowid=[$0], ITEM0=[$1], ITEM2=[$2])
> 00-15 SelectionVectorRemover
> 00-17 Filter(condition=[=(CAST($2):TIMESTAMP(0), 2013-02-04 22:34:38)])
> 00-18 Project(rowid=[$0], ITEM=[ITEM($1, 'city')], ITEM2=[ITEM(ITEM($2,
> 'irs'), 'firstlogin')])
> 00-19 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=null], columns=[`rowid`, `address`.`city`,
> `activity`.`irs`.`firstlogin`], maxwidth=2]])
> [ERROR] IndexPlanTest.testRowkeyJoinPushdown_6:1799 Did not find expected
> pattern in plan: RowKeyJoin
> 00-00 Screen
> 00-01 Project(ssn=[$0])
> 00-02 Project(ssn=[$1])
> 00-03 HashJoin(condition=[=($0, $2)], joinType=[inner], semi-join: =[true])
> 00-05 Project(_id=[$0], ITEM=[ITEM($1, 'ssn')])
> 00-07 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=null], columns=[`_id`, `id`.`ssn`], maxwidth=2]])
> 00-04 Project(EXPR$0=[CAST(CAST($0):INTEGER):VARCHAR(10) CHARACTER SET
> "UTF-16LE" COLLATE "UTF-16LE$en_US$primary"])
> 00-06 Project(rowid=[$1], ITEM=[$2], ITEM2=[$3], ITEM0=[$0])
> 00-08 HashJoin(condition=[=($2, $0)], joinType=[inner], semi-join: =[false])
> 00-10 Project(ITEM=[ITEM($0, 'city')])
> 00-12 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=null], columns=[`address`.`city`], maxwidth=2]])
> 00-09 Project(rowid=[$0], ITEM0=[$1], ITEM2=[$2])
> 00-11 SelectionVectorRemover
> 00-13 Filter(condition=[=(CAST($2):TIMESTAMP(0), 2013-02-04 22:34:38)])
> 00-14 Project(rowid=[$0], ITEM=[ITEM($1, 'city')], ITEM2=[ITEM(ITEM($2,
> 'irs'), 'firstlogin')])
> 00-15 Scan(table=[[hbase, index_test_primary]], groupscan=[JsonTableGroupScan
> [ScanSpec=JsonScanSpec [tableName=maprfs:///tmp/index_test_primary,
> condition=null], columns=[`rowid`, `address`.`city`,
> `activity`.`irs`.`firstlogin`], maxwidth=2]])
> [ERROR] IndexPlanTest.testRowkeyJoinPushdown_7:1825 Incorrect number of rows
> returned by query. expected:<1> but was:<0>
> [ERROR] IndexPlanTest.testRowkeyJoinPushdown_9:1864 Incorrect number of rows
> returned by query. expected:<1> but was:<0>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)