SortOrder Unevaluable Unary Expression¶
SortOrder
is a <
-
AstBuilder
is requested to <> -
<
>, < >, < >, < >, < >, and < > operators are used
SortOrder
is used to specify the <
SortOrder
is an unevaluable expression.
[[foldable]] SortOrder
is never <
[[catalyst-dsl]] TIP: Use <SortOrder
expression, e.g. for testing or Spark SQL internals exploration.
NOTE: <
=== [[apply]] Creating SortOrder Instance -- apply
Factory Method
[source, scala]¶
apply( child: Expression, direction: SortDirection, sameOrderExpressions: Set[Expression] = Set.empty): SortOrder
apply
is a convenience method to create a <defaultNullOrdering
of the <
NOTE: apply
is used exclusively in spark-sql-functions-datetime.md#window[window] function.
=== [[asc]][[asc_nullsLast]][[desc]][[desc_nullsFirst]] Catalyst DSL -- asc
, asc_nullsLast
, desc
and desc_nullsFirst
Operators
[source, scala]¶
asc: SortOrder asc_nullsLast: SortOrder desc: SortOrder desc_nullsFirst: SortOrder
asc
, asc_nullsLast
, desc
and desc_nullsFirst
<SortOrder
expression with the Ascending
or Descending
sort direction, respectively.
[source, scala]¶
import org.apache.spark.sql.catalyst.dsl.expressions._ val sortNullsLast = 'id.asc_nullsLast scala> println(sortNullsLast.sql) id
ASC NULLS LAST
=== [[creating-instance]] Creating SortOrder Instance
SortOrder
takes the following when created:
- [[child]] Child <
> - [[direction]] <
> - [[nullOrdering]]
NullOrdering
- [[sameOrderExpressions]] "Same Order" <
>
=== [[SortDirection]] SortDirection Contract
SortDirection
is the <
[[SortDirection-contract]] .SortDirection Contract [cols="1m,2",options="header",width="100%"] |=== | Method | Description
| defaultNullOrdering a| [[defaultNullOrdering]]
[source, scala]¶
defaultNullOrdering: NullOrdering¶
Used when...FIXME
| sql a| [[sql]]
[source, scala]¶
sql: String¶
Used when...FIXME |===
==== [[SortDirection-extensions]][[Ascending]][[Descending]] Ascending and Descending Sort Directions
There are two <Ascending
and Descending
.