Class Expressions
- Since:
- 3.0.0
- 
Method SummaryModifier and TypeMethodDescriptionstatic Transformapply(String name, Expression... args) Create a logical transform for applying a named transform.static TransformCreate a bucket transform for one or more columns.static NamedReferenceCreate a named reference expression for a (nested) column.static TransformCreate a daily transform for a timestamp or date column.static TransformCreate an hourly transform for a timestamp column.static TransformCreate an identity transform for a column.static <T> Literal<T>literal(T value) Create a literal from a value.static TransformCreate a monthly transform for a timestamp or date column.static SortOrdersort(Expression expr, SortDirection direction) Create a sort expression.static SortOrdersort(Expression expr, SortDirection direction, NullOrdering nullOrder) Create a sort expression.static TransformCreate a yearly transform for a timestamp or date column.
- 
Method Details- 
applyCreate a logical transform for applying a named transform.This transform can represent applying any named transform. - Parameters:
- name- the transform name
- args- expression arguments to the transform
- Returns:
- a logical transform
 
- 
columnCreate a named reference expression for a (nested) column.- Parameters:
- name- The column name. It refers to nested column if name contains dot.
- Returns:
- a named reference for the column
 
- 
literalCreate a literal from a value.The JVM type of the value held by a literal must be the type used by Spark's InternalRow API for the literal's SQL data type.- Type Parameters:
- T- the JVM type of the value
- Parameters:
- value- a value
- Returns:
- a literal expression for the value
 
- 
bucketCreate a bucket transform for one or more columns.This transform represents a logical mapping from a value to a bucket id in [0, numBuckets) based on a hash of the value. The name reported by transforms created with this method is "bucket". - Parameters:
- numBuckets- the number of output buckets
- columns- input columns for the bucket transform
- Returns:
- a logical bucket transform with name "bucket"
 
- 
identityCreate an identity transform for a column.This transform represents a logical mapping from a value to itself. The name reported by transforms created with this method is "identity". - Parameters:
- column- an input column
- Returns:
- a logical identity transform with name "identity"
 
- 
yearsCreate a yearly transform for a timestamp or date column.This transform represents a logical mapping from a timestamp or date to a year, such as 2018. The name reported by transforms created with this method is "years". - Parameters:
- column- an input timestamp or date column
- Returns:
- a logical yearly transform with name "years"
 
- 
monthsCreate a monthly transform for a timestamp or date column.This transform represents a logical mapping from a timestamp or date to a month, such as 2018-05. The name reported by transforms created with this method is "months". - Parameters:
- column- an input timestamp or date column
- Returns:
- a logical monthly transform with name "months"
 
- 
daysCreate a daily transform for a timestamp or date column.This transform represents a logical mapping from a timestamp or date to a date, such as 2018-05-13. The name reported by transforms created with this method is "days". - Parameters:
- column- an input timestamp or date column
- Returns:
- a logical daily transform with name "days"
 
- 
hoursCreate an hourly transform for a timestamp column.This transform represents a logical mapping from a timestamp to a date and hour, such as 2018-05-13, hour 19. The name reported by transforms created with this method is "hours". - Parameters:
- column- an input timestamp column
- Returns:
- a logical hourly transform with name "hours"
 
- 
sortCreate a sort expression.- Parameters:
- expr- an expression to produce values to sort
- direction- direction of the sort
- nullOrder- null order of the sort
- Returns:
- a SortOrder
- Since:
- 3.2.0
 
- 
sortCreate a sort expression.- Parameters:
- expr- an expression to produce values to sort
- direction- direction of the sort
- Returns:
- a SortOrder
- Since:
- 3.2.0
 
 
-