/** * True if the partition exprs and ordering elements and the window of analyticExpr match ours. */ public boolean isCompatible(AnalyticExpr analyticExpr) { if (requiresIndependentEval(analyticExprs.get(0)) || requiresIndependentEval(analyticExpr)) { return false; } if (!Expr.equalSets(analyticExpr.getPartitionExprs(), partitionByExprs)) { return false; } if (!analyticExpr.getOrderByElements().equals(orderByElements)) return false; if ((window == null) != (analyticExpr.getWindow() == null)) return false; if (window == null) return true; return analyticExpr.getWindow().equals(window); }
public WindowGroup( AnalyticExpr analyticExpr, SlotDescriptor logicalOutputSlot, SlotDescriptor logicalIntermediateSlot) { partitionByExprs = analyticExpr.getPartitionExprs(); orderByElements = analyticExpr.getOrderByElements(); window = analyticExpr.getWindow(); analyticExprs.add(analyticExpr); analyticFnCalls.add(analyticExpr.getFnCall()); logicalOutputSlots.add(logicalOutputSlot); logicalIntermediateSlots.add(logicalIntermediateSlot); }