and(equal("dateint", 20180417), lessThanOrEqual("hour", 4)))); Expression projection = Projections.inclusive(spec).project(filter);
Expression expr = Projections.strict(spec).project(predicate); UnboundPredicate<?> projected = assertAndUnwrapUnbound(expr);
Expression expr = Projections.inclusive(spec).project(predicate); UnboundPredicate<?> projected = assertAndUnwrapUnbound(expr);
@Override public List<ManifestFile> apply(TableMetadata base) { if (validateAddedFiles) { PartitionSpec spec = writeSpec(); Expression rowFilter = rowFilter(); Expression inclusiveExpr = Projections.inclusive(spec).project(rowFilter); Evaluator inclusive = new Evaluator(spec.partitionType(), inclusiveExpr); Expression strictExpr = Projections.strict(spec).project(rowFilter); Evaluator strict = new Evaluator(spec.partitionType(), strictExpr); StrictMetricsEvaluator metrics = new StrictMetricsEvaluator( base.schema(), rowFilter); for (DataFile file : addedFiles()) { // the real test is that the strict or metrics test matches the file, indicating that all // records in the file match the filter. inclusive is used to avoid testing the metrics, // which is more complicated ValidationException.check( inclusive.eval(file.partition()) && (strict.eval(file.partition()) || metrics.eval(file)), "Cannot append file with rows that do not match filter: %s: %s", rowFilter, file.path()); } } return super.apply(base); } }
@Override public FilteredManifest filterRows(Expression expr) { return new FilteredManifest(this, Projections.inclusive(spec).project(expr), expr, ALL_COLUMNS); }
public InclusiveManifestEvaluator(PartitionSpec spec, Expression rowFilter) { this.struct = spec.partitionType(); this.expr = Binder.bind(struct, rewriteNot(Projections.inclusive(spec).project(rowFilter))); }
@Override public FilteredManifest filterRows(Expression expr) { Expression projected = Projections.inclusive(reader.spec()).project(expr); return new FilteredManifest(reader, Expressions.and(partFilter, projected), Expressions.and(rowFilter, expr), columns); }