Class Transforms
java.lang.Object
org.apache.gravitino.rel.expressions.transforms.Transforms
Helper methods to create logical transforms to pass into Apache Gravitino.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A transform that applies a function to the input value.static final class
A transform that returns the bucket of the input value.static final class
A transform that returns the day of the input value.static final class
A transform that returns the hour of the input value.static final class
A transform that returns the input value.static final class
A transform that includes multiple fields in a list.static final class
A transform that returns the month of the input value.static final class
A transform that returns the range of the input value.static final class
A transform that returns the truncated value of the input value with the given width.static final class
A transform that returns the year of the input value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Transform[]
An empty array of transforms.static final String
The name of the bucket transform.static final String
The name of the day transform.static final String
The name of the hour transform.static final String
The name of the identity transform.static final String
The name of the list transform.static final String
The name of the month transform.static final String
The name of the range transform.static final String
The name of the truncate transform.static final String
The name of the year transform. -
Method Summary
Modifier and TypeMethodDescriptionstatic Transforms.ApplyTransform
apply
(String name, Expression[] arguments) Create a transform that applies a function to the input value.static Transforms.BucketTransform
Create a transform that returns the bucket of the input value.static Transforms.DayTransform
Create a transform that returns the day of the input value.static Transforms.DayTransform
Create a transform that returns the day of the input value.static Transforms.HourTransform
Create a transform that returns the hour of the input value.static Transforms.HourTransform
Create a transform that returns the hour of the input value.static Transforms.IdentityTransform
Create a transform that returns the input value.static Transforms.IdentityTransform
Create a transform that returns the input value.static Transforms.ListTransform
Create a transform that includes multiple fields in a list.static Transforms.ListTransform
list
(String[][] fieldNames, ListPartition[] assignments) Create a transform that includes multiple fields in a list with preassigned list partitions.static Transforms.MonthTransform
Create a transform that returns the month of the input value.static Transforms.MonthTransform
Create a transform that returns the month of the input value.static Transforms.RangeTransform
Create a transform that returns the range of the input value.static Transforms.RangeTransform
range
(String[] fieldName, RangePartition[] assignments) Create a transform that returns the range of the input value with preassigned range partitions.static Transforms.TruncateTransform
Create a transform that returns the truncated value of the input value with the given width.static Transforms.TruncateTransform
Create a transform that returns the truncated value of the input value with the given width.static Transforms.YearTransform
Create a transform that returns the year of the input value.static Transforms.YearTransform
Create a transform that returns the year of the input value.
-
Field Details
-
EMPTY_TRANSFORM
An empty array of transforms. -
NAME_OF_IDENTITY
The name of the identity transform.- See Also:
-
NAME_OF_YEAR
The name of the year transform. The year transform returns the year of the input value.- See Also:
-
NAME_OF_MONTH
The name of the month transform. The month transform returns the month of the input value.- See Also:
-
NAME_OF_DAY
The name of the day transform. The day transform returns the day of the input value.- See Also:
-
NAME_OF_HOUR
The name of the hour transform. The hour transform returns the hour of the input value.- See Also:
-
NAME_OF_BUCKET
The name of the bucket transform. The bucket transform returns the bucket of the input value.- See Also:
-
NAME_OF_TRUNCATE
The name of the truncate transform. The truncate transform returns the truncated value of the- See Also:
-
NAME_OF_LIST
The name of the list transform. The list transform includes multiple fields in a list.- See Also:
-
NAME_OF_RANGE
The name of the range transform. The range transform returns the range of the input value.- See Also:
-
-
Method Details
-
identity
Create a transform that returns the input value.- Parameters:
fieldName
- The field name to transform- Returns:
- The created transform
-
identity
Create a transform that returns the input value.- Parameters:
columnName
- The column name to transform- Returns:
- The created transform
-
year
Create a transform that returns the year of the input value.- Parameters:
fieldName
- The field name to transform- Returns:
- The created transform
-
year
Create a transform that returns the year of the input value.- Parameters:
columnName
- The column name to transform- Returns:
- The created transform
-
month
Create a transform that returns the month of the input value.- Parameters:
fieldName
- The field name to transform- Returns:
- The created transform
-
month
Create a transform that returns the month of the input value.- Parameters:
columnName
- The column name to transform- Returns:
- The created transform
-
day
Create a transform that returns the day of the input value.- Parameters:
fieldName
- The field name to transform- Returns:
- The created transform
-
day
Create a transform that returns the day of the input value.- Parameters:
columnName
- The column name to transform- Returns:
- The created transform
-
hour
Create a transform that returns the hour of the input value.- Parameters:
fieldName
- The field name to transform- Returns:
- The created transform
-
hour
Create a transform that returns the hour of the input value.- Parameters:
columnName
- The column name to transform- Returns:
- The created transform
-
bucket
Create a transform that returns the bucket of the input value.- Parameters:
numBuckets
- The number of buckets to usefieldNames
- The field names to transform- Returns:
- The created transform
-
list
Create a transform that includes multiple fields in a list.- Parameters:
fieldNames
- The field names to include in the list- Returns:
- The created transform
-
list
Create a transform that includes multiple fields in a list with preassigned list partitions.- Parameters:
fieldNames
- The field names to include in the listassignments
- The preassigned list partitions- Returns:
- The created transform
-
range
Create a transform that returns the range of the input value.- Parameters:
fieldName
- The field name to transform- Returns:
- The created transform
-
range
Create a transform that returns the range of the input value with preassigned range partitions.- Parameters:
fieldName
- The field name to transformassignments
- The preassigned range partitions- Returns:
- The created transform
-
truncate
Create a transform that returns the truncated value of the input value with the given width.- Parameters:
width
- The width to truncate tofieldName
- The field name to transform- Returns:
- The created transform
-
truncate
Create a transform that returns the truncated value of the input value with the given width.- Parameters:
width
- The width to truncate tocolumnName
- The column name to transform- Returns:
- The created transform
-
apply
Create a transform that applies a function to the input value.- Parameters:
name
- The name of the function to applyarguments
- The arguments to the function- Returns:
- The created transform
-