MCPcopy Create free account
hub / github.com/apache/impala / findSrcExpr

Method findSrcExpr

fe/src/main/java/org/apache/impala/analysis/Expr.java:1735–1751  ·  view source on GitHub ↗

Returns the source expression for this expression. Traverses the source exprs of intermediate slot descriptors to resolve materialization points (e.g., aggregations). Returns null if there are multiple source Exprs mapped to the expression at any given point.

()

Source from the content-addressed store, hash-verified

1733 * mapped to the expression at any given point.
1734 */
1735 public Expr findSrcExpr() {
1736 // If the source expression is a constant expression, it won't have a scanSlotRef
1737 // and we can return this.
1738 if (isConstant()) {
1739 return this;
1740 }
1741 SlotRef slotRef = unwrapSlotRef(false);
1742 if (slotRef == null) return null;
1743 SlotDescriptor slotDesc = slotRef.getDesc();
1744 if (slotDesc.isScanSlot()) return slotRef;
1745 if (slotDesc.getSourceExprs().size() == 1) {
1746 return slotDesc.getSourceExprs().get(0).findSrcExpr();
1747 }
1748 // No known source expr, or there are several source exprs meaning the slot is
1749 // has no single source table.
1750 return null;
1751 }
1752
1753 /**
1754 * Returns the descriptor of the scan slot that directly or indirectly produces

Callers 2

findSrcScanSlotMethod · 0.95
addConjunctsToNodeMethod · 0.80

Calls 7

isConstantMethod · 0.95
unwrapSlotRefMethod · 0.95
getDescMethod · 0.95
isScanSlotMethod · 0.95
getSourceExprsMethod · 0.95
getMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected