@Override public boolean isCloneExpression() { return delegate.isCloneExpression(); }
public boolean isCloneNode(Expression node, List<Expression> children) { return node.isCloneExpression(); } }
@Override public boolean isCloneExpression() { return children.get(0).isCloneExpression(); } }
private void init(List<Expression> children) { this.children = ImmutableList.copyOf(children); boolean isStateless = true; boolean isNullable = false; boolean requiresFinalEvaluation = false; boolean cloneExpression = false; this.determinism = Determinism.ALWAYS; for (int i = 0; i < children.size(); i++) { Expression child = children.get(i); isNullable |= child.isNullable(); isStateless &= child.isStateless(); this.determinism = this.determinism.combine(child.getDeterminism()); requiresFinalEvaluation |= child.requiresFinalEvaluation(); cloneExpression |= child.isCloneExpression(); } this.isStateless = isStateless; this.isNullable = isNullable; this.requiresFinalEvaluation = requiresFinalEvaluation; this.cloneExpression = cloneExpression; }
public RowProjector cloneIfNecessary() { if (!cloneRequired) { return this; } List<ColumnProjector> clonedColProjectors = new ArrayList<ColumnProjector>(columnProjectors.size()); for (int i = 0; i < this.columnProjectors.size(); i++) { ColumnProjector colProjector = columnProjectors.get(i); Expression expression = colProjector.getExpression(); if (expression.isCloneExpression()) { CloneExpressionVisitor visitor = new CloneExpressionVisitor(); Expression clonedExpression = expression.accept(visitor); clonedColProjectors.add(new ExpressionProjector(colProjector.getName(), colProjector.getTableName(), clonedExpression, colProjector.isCaseSensitive())); } else { clonedColProjectors.add(colProjector); } } return new RowProjector(clonedColProjectors, this.estimatedSize, this.isProjectEmptyKeyValue, this.hasUDFs, this.isProjectAll); }
for (int i = 0; i < this.columnProjectors.size(); i++) { Expression expression = this.columnProjectors.get(i).getExpression(); if (expression.isCloneExpression()) { cloneRequired = true; break;