Class PushdownPredicates
These methods check whether an ESQL expression has the right structure for pushdown:
field reference on the left, foldable literal on the right, supported operator, and
a data type the target format can handle. The format-specific type check is provided
as a Predicate<DataType> so each format plugs in its own supported types.
Boolean connective rules (AND partial vs full pushdown, OR, NOT) are intentionally excluded — ORC allows partial AND pushdown while Iceberg requires both sides, so the traversal logic stays format-specific.
Virtual columns (MetadataAttribute for ES-index metadata like _id/_index,
any VirtualAttribute for engine-synthesized columns like _file.*) never live in the
physical file schema, so format-level readers cannot evaluate predicates / aggregates against
them and these helpers always reject them. Identification is type-based: name conventions
(e.g. the _file. prefix) are surface and may be aliased away, but the marker
interface stays attached across renames and serialization.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisComparison(EsqlBinaryComparison bc, Predicate<DataType> typeSupported) Checks if a binary comparison can be pushed down: left side is a non-virtual field reference, right side is a foldable literal, operator is one of the six standard comparisons, and the field's data type is supported by the target format.static booleanisContains(Contains c, Predicate<DataType> typeSupported) Checks if a Contains expression can be pushed down: field is a single-value named expression with a supported data type, and the substring is foldable.static booleanisEndsWith(EndsWith ew, Predicate<DataType> typeSupported) Checks if an EndsWith expression can be pushed down: field is a single-value named expression with a supported data type, and the suffix is foldable.static booleanChecks if an IN expression can be pushed down: value is a non-virtual field reference with a supported data type, all list items are foldable, and at least one is non-null.static booleanisIsNotNull(IsNotNull isNotNull, Predicate<DataType> typeSupported) Checks if an IS NOT NULL expression can be pushed down: field is a non-virtual named expression with a supported data type.static booleanChecks if an IS NULL expression can be pushed down: field is a non-virtual named expression with a supported data type.static booleanChecks if a range expression can be pushed down: value is a non-virtual field reference with a supported data type, and both bounds are foldable.static booleanisStartsWith(StartsWith sw, Predicate<DataType> typeSupported) Checks if a StartsWith expression can be pushed down: field is a single-value named expression with a supported data type, and the prefix is foldable.static booleanReturnstruewhenerepresents a column that has no physical presence in the source data and therefore cannot be evaluated by a format-level scan.
-
Method Details
-
isVirtualColumn
Returnstruewhenerepresents a column that has no physical presence in the source data and therefore cannot be evaluated by a format-level scan. Two cases:MetadataAttribute— Elasticsearch document metadata (_id,_index,_score, ...). Real per-document values, but external-file readers (Parquet, ORC) have no concept of them.- Any
VirtualAttribute— engine-synthesized columns (_file.*today) materialized byVirtualColumnIteratoron the producer thread.
-
isComparison
Checks if a binary comparison can be pushed down: left side is a non-virtual field reference, right side is a foldable literal, operator is one of the six standard comparisons, and the field's data type is supported by the target format. -
isIn
Checks if an IN expression can be pushed down: value is a non-virtual field reference with a supported data type, all list items are foldable, and at least one is non-null. -
isIsNull
Checks if an IS NULL expression can be pushed down: field is a non-virtual named expression with a supported data type. -
isIsNotNull
Checks if an IS NOT NULL expression can be pushed down: field is a non-virtual named expression with a supported data type. -
isRange
Checks if a range expression can be pushed down: value is a non-virtual field reference with a supported data type, and both bounds are foldable. -
isStartsWith
Checks if a StartsWith expression can be pushed down: field is a single-value named expression with a supported data type, and the prefix is foldable. -
isEndsWith
Checks if an EndsWith expression can be pushed down: field is a single-value named expression with a supported data type, and the suffix is foldable. -
isContains
Checks if a Contains expression can be pushed down: field is a single-value named expression with a supported data type, and the substring is foldable.
-