public class HiveIntersectRewriteRule
extends org.apache.calcite.plan.RelOptRule
HiveIntersect
Rewrite: (GB-Union All-GB)-GB-UDTF (on all attributes)
Example: R1 Intersect All R2
R3 = GB(R1 on all attributes + count() as c) union all GB(R2 on all attributes + count() as c)
R4 = GB(R3 on all attributes + count(c) as cnt + min(c) as m)
R5 = Fil ( cnt == #branch )
If it is intersect all then
R6 = UDTF (R5) which will explode the tuples based on min(c).
R7 = Proj(R6 on all attributes)
Else
R6 = Proj(R5 on all attributes)
elseModifier and Type | Field and Description |
---|---|
static HiveIntersectRewriteRule |
INSTANCE |
protected static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
void |
onMatch(org.apache.calcite.plan.RelOptRuleCall call) |
public static final HiveIntersectRewriteRule INSTANCE
protected static final org.slf4j.Logger LOG
Copyright © 2022 The Apache Software Foundation. All rights reserved.