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 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 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 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 Expressionor(Expression... operands) Logical OR.static Expressionroot()The root expression: applying it to an array yields the array itself.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. -
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. -
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. -
nullLiteral
Create a typed null literal of the given primitiveExpression.DType.
-