@Override public Void visitBooleanOperator(BooleanOperator op, ErrorCollector errors) throws RuntimeException { int i = 0; for (LogicalExpression arg : op.args) { if ( arg.getMajorType().getMinorType() != MinorType.BIT) { errors .addGeneralError( arg.getPosition(), String .format( "Failure composing boolean operator %s. All conditions must return a boolean type. Condition %d was of Type %s.", op.getName(), i, arg.getMajorType().getMinorType())); } i++; } return null; }
@Override public Boolean visitFunctionHolderExpression(FunctionHolderExpression holder, ErrorCollector errors) { boolean allArgsAreConstant = true; for (int i = 0; i < holder.args.size(); i++) { boolean thisArgIsConstant = holder.args.get(i).accept(this, errors); if (!thisArgIsConstant) { allArgsAreConstant = false; if (holder.argConstantOnly(i)) { errors.addGeneralError( // holder.args.get(i).getPosition(), // String.format("Function %s expects constant input for argument number %d", holder.getName(), i)); } } } return allArgsAreConstant; }
@Override public Boolean visitFunctionHolderExpression(FunctionHolderExpression holder, ErrorCollector errors) { if (holder.isAggregating()) { for (int i = 0; i < holder.args.size(); i++) { LogicalExpression e = holder.args.get(i); if(e.accept(this, errors)) { errors.addGeneralError(e.getPosition(), String.format("Aggregating function call %s includes nested aggregations at arguments number %d. " + "This isn't allowed.", holder.getName(), i)); } } return true; } else { for (LogicalExpression e : holder.args) { if (e.accept(this, errors)) { return true; } } return false; } }
errors .addGeneralError( cond.condition.getPosition(), String .format( errors .addGeneralError( cond.condition.getPosition(), String .format(
private ParquetComparisonPredicate( LogicalExpression left, LogicalExpression right, BiFunction<Statistics<C>, Statistics<C>, RowsMatch> predicate ) { super(left.getPosition()); this.left = left; this.right = right; this.predicate = predicate; }
private ParquetIsPredicate(LogicalExpression expr, BiFunction<Statistics<C>, RangeExprEvaluator<C>, RowsMatch> predicate) { super(expr.getPosition()); this.expr = expr; this.predicate = predicate; }
@Override public Void visitBooleanOperator(BooleanOperator op, ErrorCollector errors) throws RuntimeException { int i = 0; for (LogicalExpression arg : op.args) { if ( arg.getMajorType().getMinorType() != MinorType.BIT) { errors .addGeneralError( arg.getPosition(), String .format( "Failure composing boolean operator %s. All conditions must return a boolean type. Condition %d was of Type %s.", op.getName(), i, arg.getMajorType().getMinorType())); } i++; } return null; }
@Override public Boolean visitFunctionHolderExpression(FunctionHolderExpression holder, ErrorCollector errors) { boolean allArgsAreConstant = true; for (int i = 0; i < holder.args.size(); i++) { boolean thisArgIsConstant = holder.args.get(i).accept(this, errors); if (!thisArgIsConstant) { allArgsAreConstant = false; if (holder.argConstantOnly(i)) { errors.addGeneralError( // holder.args.get(i).getPosition(), // String.format("Function %s expects constant input for argument number %d", holder.getName(), i)); } } } return allArgsAreConstant; }
@Override public Boolean visitFunctionHolderExpression(FunctionHolderExpression holder, ErrorCollector errors) { if (holder.isAggregating()) { for (int i = 0; i < holder.args.size(); i++) { LogicalExpression e = holder.args.get(i); if(e.accept(this, errors)) { errors.addGeneralError(e.getPosition(), String.format("Aggregating function call %s includes nested aggregations at arguments number %d. " + "This isn't allowed.", holder.getName(), i)); } } return true; } else { for (LogicalExpression e : holder.args) { if (e.accept(this, errors)) { return true; } } return false; } }
errors .addGeneralError( cond.condition.getPosition(), String .format( errors .addGeneralError( cond.condition.getPosition(), String .format(