Package org.apache.datafusion
Class SortExpr
java.lang.Object
org.apache.datafusion.SortExpr
A single sort key passed to
DataFrame.sort(SortExpr...), mirroring DataFusion's
expr::Sort{ expr, asc, nulls_first }. Build via asc(String) or desc(String);
tweak null placement via nullsFirst(boolean).
v1 accepts column names only -- the column string is interpreted as a column
reference, not a SQL expression. Complex sort keys (e.g. "a + b") are intentionally
deferred until the Java binding gains an Expr builder.
Defaults match DataFusion: asc(String) sorts ascending with NULLs last; desc(String) sorts descending with NULLs first.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SortExprSort the given column ascending, with NULLs placed last.booleantrueif ascending,falseif descending.column()The column name this sort key references.static SortExprSort the given column descending, with NULLs placed first.booleantrueif NULLs are placed first,falseif last.nullsFirst(boolean v) Override the default NULL placement.
-
Method Details
-
asc
Sort the given column ascending, with NULLs placed last. -
desc
Sort the given column descending, with NULLs placed first. -
nullsFirst
Override the default NULL placement.true= NULLs first,false= last. -
column
The column name this sort key references. -
ascending
public boolean ascending()trueif ascending,falseif descending. -
nullsFirst
public boolean nullsFirst()trueif NULLs are placed first,falseif last.
-