Package dev.vortex.api
Class Expression
java.lang.Object
dev.vortex.api.Expression
A Vortex expression node backed by a native pointer.
Expressions are composed via the static factories (root(), getItem(String, Expression), etc.).
Each returned Expression owns its native pointer; the pointer is released automatically when the
Expression is no longer reachable. Passing an expression as an input to a builder does not transfer
ownership — the resulting expression is an independent copy on the native side.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBinary operator codes; must match the Rustparse_optable.static enumPrimitiveExpression.DTypes that can be used to construct typed null literals vianullLiteral(DType).static enumStrategy for resolving duplicate field names inmerge(DuplicateHandling, Expression...).static enumTime units for Date/Timestamp literals. -
Method Summary
Modifier and TypeMethodDescriptionstatic Expressionand(Expression... operands) Logical AND.static Expressionbetween(Expression value, Expression lower, Expression upper, boolean lowerStrict, boolean upperStrict) value BETWEEN lower AND upper.static Expressionbinary(Expression.BinaryOp op, Expression lhs, Expression rhs) static ExpressionShortcut forgetItem(fieldName, root()).static ExpressionAccess a nested field by walkingfieldNamesstarting from the root of the array.static ExpressiongetItem(String fieldName, Expression child) Access a named field from a struct expression.static ExpressionisNotNull(Expression child) static ExpressionisNull(Expression child) static Expressionlike(Expression child, Expression pattern, boolean negated, boolean caseInsensitive) SQLLIKEpattern match.static Expressionliteral(boolean value) static Expressionliteral(byte value) static Expressionliteral(byte[] value) static Expressionliteral(double value) static Expressionliteral(float value) static Expressionliteral(int value) static Expressionliteral(long value) static Expressionliteral(short value) static Expressionstatic ExpressionCreate a UUID literal, enabling predicate pushdown over UUID columns.static ExpressionliteralDate(long value, Expression.TimeUnit unit) Create a Date literal.static ExpressionliteralDecimal(BigInteger unscaledValue, int precision, int scale) Create a decimal literal from its unscaled two's-complement big-endian byte representation (i.e.static ExpressionliteralTimestamp(long value, Expression.TimeUnit unit, String timezone) Create a Timestamp literal.static ExpressionliteralUuid(byte[] bigEndianBytes) Create a UUID literal from its 16-byte big-endian (network order) representation, for example the bytes of Arrow's canonical UUID type or aUUIDserialized most-significant-bits first.static Expressionmerge(Expression... expressions) Merge struct expressions, failing if any field name is duplicated.static Expressionmerge(Expression.DuplicateHandling duplicateHandling, Expression... expressions) Merge struct expressions into a single struct, combining their fields in order.static Expressionnot(Expression child) static ExpressionnullLiteral(Expression.DType dtype) Create a typed null literal of the given primitiveExpression.DType.static Expressionstatic ExpressionNull Date literal.static ExpressionnullLiteralDecimal(int precision, int scale) Create a null decimal literal with the specified precision and scale.static ExpressionnullLiteralTimestamp(Expression.TimeUnit unit, String timezone) Null Timestamp literal.static ExpressionCreate a null UUID literal.static Expressionor(Expression... operands) Logical OR.static Expressionpack(String[] fieldNames, Expression[] expressions, boolean nullable) Creates an expression that packs values into a struct with named fields.static Expressionroot()The root expression: applying it to an array yields the array itself.static ExpressionrowIdx()The row-index expression.static Expressionselect(String[] fieldNames, Expression child) Project a subset of fields out of a struct expression.
-
Method Details
-
root
The root expression: applying it to an array yields the array itself. -
rowIdx
The row-index expression. When evaluated as part of a Vortex scan it yields, as a non-nullableu64, each row's index in the file before filtering: the index is assigned to the unfiltered rows, so filtered-out rows leave gaps and the surviving rows keep their original positions rather than being renumbered. It cannot be evaluated outside of a scan. -
getItem
Access a named field from a struct expression. -
column
Shortcut forgetItem(fieldName, root()). -
column
Access a nested field by walkingfieldNamesstarting from the root of the array. With a single name this is equivalent tocolumn(String). -
select
Project a subset of fields out of a struct expression. -
pack
Creates an expression that packs values into a struct with named fields. -
merge
public static Expression merge(Expression.DuplicateHandling duplicateHandling, Expression... expressions) Merge struct expressions into a single struct, combining their fields in order.Every input must evaluate to a non-nullable struct. When the same field name appears in more than one input,
duplicateHandlingdecides the result. Fields are not merged recursively — a later field replaces an earlier one with the same name. Merging zero expressions yields an empty struct. -
merge
Merge struct expressions, failing if any field name is duplicated. Equivalent tomerge(DuplicateHandling, Expression...)withExpression.DuplicateHandling.ERROR. -
and
Logical AND. Requires at least one operand. -
or
Logical OR. Requires at least one operand. -
binary
-
not
-
isNull
-
isNotNull
-
like
public static Expression like(Expression child, Expression pattern, boolean negated, boolean caseInsensitive) SQLLIKEpattern match.- Parameters:
negated- whether to invert the result (i.e.NOT LIKE)caseInsensitive- whether to perform case-insensitive matching (ILIKE)
-
between
public static Expression between(Expression value, Expression lower, Expression upper, boolean lowerStrict, boolean upperStrict) value BETWEEN lower AND upper.- Parameters:
lowerStrict-trueforlower < value;falseforlower <= value.upperStrict-trueforvalue < upper;falseforvalue <= upper.
-
literal
-
nullLiteralBool
-
literal
-
literal
-
literal
-
literal
-
literal
-
literal
-
literal
-
literal
-
literalDecimal
Create a decimal literal from its unscaled two's-complement big-endian byte representation (i.e. the value returned byBigInteger.toByteArray()). -
nullLiteralDecimal
Create a null decimal literal with the specified precision and scale. -
literalDate
Create a Date literal. Thevalueis the number ofunitunits since the Unix epoch.- Parameters:
unit- onlyExpression.TimeUnit.DAYSandExpression.TimeUnit.MILLISECONDSare valid for Date.
-
nullLiteralDate
Null Date literal. SeeliteralDate(long, TimeUnit)for theunitconstraints. -
literalTimestamp
Create a Timestamp literal. Thevalueis the number ofunitunits since the Unix epoch.- Parameters:
timezone- optional IANA timezone identifier (e.g."UTC","America/Los_Angeles"). Passnullfor a local (zone-naive) timestamp.
-
nullLiteralTimestamp
Null Timestamp literal. SeeliteralTimestamp(long, TimeUnit, String)for parameter semantics. -
literal
Create a UUID literal, enabling predicate pushdown over UUID columns. The value is stored as its 16-byte big-endian (network order) representation, matching Vortex's UUID extension type and Arrow's canonical UUID type. -
literalUuid
Create a UUID literal from its 16-byte big-endian (network order) representation, for example the bytes of Arrow's canonical UUID type or aUUIDserialized most-significant-bits first.- Parameters:
bigEndianBytes- exactly 16 bytes; usenullLiteralUuid()for a null literal
-
nullLiteralUuid
Create a null UUID literal. -
nullLiteral
Create a typed null literal of the given primitiveExpression.DType.
-