Package

org.apache.spark.sql.catalyst

expressions

Permalink

package expressions

A set of classes that can be used to represent trees of relational expressions. A key goal of the expression library is to hide the details of naming and scoping from developers who want to manipulate trees of relational operators. As such, the library defines a special type of expression, a NamedExpression in addition to the standard collection of expressions.

Standard Expressions

A library of standard expressions (e.g., Add, EqualTo), aggregates (e.g., SUM, COUNT), and other computations (e.g. UDFs). Each expression type is capable of determining its output schema as a function of its children's output schema.

Named Expressions

Some expression are named and thus can be referenced by later operators in the dataflow graph. The two types of named expressions are AttributeReferences and Aliases. AttributeReferences refer to attributes of the input tuple for a given operator and form the leaves of some expression trees. Aliases assign a name to intermediate computations. For example, in the SQL statement SELECT a+b AS c FROM ..., the expressions a and b would be represented by AttributeReferences and c would be represented by an Alias.

During analysis, all named expressions are assigned a globally unique expression id, which can be used for equality comparisons. While the original names are kept around for debugging purposes, they should never be used to check if two attributes refer to the same value, as plan transformations can result in the introduction of naming ambiguity. For example, consider a plan that contains subqueries, both of which are reading from the same table. If an optimization removes the subqueries, scoping information would be destroyed, eliminating the ability to reason about which subquery produced a given attribute.

Evaluation

The result of expressions can be evaluated using the Expression.apply(Row) method.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. expressions
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. case class Abs(child: Expression) extends UnaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    A function that get the absolute value of the numeric value.

    A function that get the absolute value of the numeric value.

    Annotations
    @ExpressionDescription()
  2. case class Acos(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  3. case class Add(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  4. case class AddItemToSet(item: Expression, set: Expression) extends Expression with CodegenFallback with Product with Serializable

    Permalink

    Adds an item to a set.

    Adds an item to a set. For performance, this expression mutates its input during evaluation. Note: this expression is internal and created only by the GeneratedAggregate, we don't need to do type check for it.

  5. case class AddMonths(startDate: Expression, numMonths: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the date that is num_months after start_date.

  6. trait AggregateExpression extends Expression with Unevaluable

    Permalink
  7. trait AggregateExpression1 extends Expression with AggregateExpression

    Permalink
  8. abstract class AggregateFunction1 extends LeafExpression with Serializable

    Permalink

    A specific implementation of an aggregate function.

    A specific implementation of an aggregate function. Used to wrap a generic AggregateExpression1 with an algorithm that will be used to compute one specific result.

  9. case class Alias(child: Expression, name: String)(exprId: ExprId = NamedExpression.newExprId, qualifiers: Seq[String] = Nil, explicitMetadata: Option[Metadata] = None) extends UnaryExpression with NamedExpression with Product with Serializable

    Permalink

    Used to assign a new name to a computation.

    Used to assign a new name to a computation. For example the SQL expression "1 + 1 AS a" could be represented as follows: Alias(Add(Literal(1), Literal(1)), "a")()

    Note that exprId and qualifiers are in a separate parameter list because we only pattern match on child and name.

    child

    the computation being performed

    name

    the name to be associated with the result of computing child.

    exprId

    A globally unique id used to check if an AttributeReference refers to this alias. Auto-assigned if left blank.

    explicitMetadata

    Explicit metadata associated with this alias that overwrites child's.

  10. case class And(left: Expression, right: Expression) extends BinaryOperator with Predicate with Product with Serializable

    Permalink
  11. case class ApproxCountDistinct(child: Expression, relativeSD: Double = 0.05) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  12. case class ApproxCountDistinctMerge(child: Expression, relativeSD: Double) extends UnaryExpression with AggregateExpression1 with Product with Serializable

    Permalink
  13. case class ApproxCountDistinctMergeFunction(expr: Expression, base: AggregateExpression1, relativeSD: Double) extends AggregateFunction1 with Product with Serializable

    Permalink
  14. case class ApproxCountDistinctPartition(child: Expression, relativeSD: Double) extends UnaryExpression with AggregateExpression1 with Product with Serializable

    Permalink
  15. case class ApproxCountDistinctPartitionFunction(expr: Expression, base: AggregateExpression1, relativeSD: Double) extends AggregateFunction1 with Product with Serializable

    Permalink
  16. case class ArrayContains(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Checks if the array (left) has the element (right)

  17. case class Ascii(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the numeric value of the first character of str.

  18. case class Asin(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  19. case class AtLeastNNonNulls(n: Int, children: Seq[Expression]) extends Expression with Predicate with Product with Serializable

    Permalink

    A predicate that is evaluated to be true if there are at least n non-null and non-NaN values.

  20. case class Atan(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  21. case class Atan2(left: Expression, right: Expression) extends BinaryMathExpression with Product with Serializable

    Permalink
  22. abstract class Attribute extends LeafExpression with NamedExpression

    Permalink
  23. class AttributeEquals extends AnyRef

    Permalink
    Attributes
    protected
  24. class AttributeMap[A] extends Map[Attribute, A] with Serializable

    Permalink
  25. case class AttributeReference(name: String, dataType: DataType, nullable: Boolean = true, metadata: Metadata = Metadata.empty)(exprId: ExprId = NamedExpression.newExprId, qualifiers: Seq[String] = Nil) extends Attribute with Unevaluable with Product with Serializable

    Permalink

    A reference to an attribute produced by another operator in the tree.

    A reference to an attribute produced by another operator in the tree.

    name

    The name of this attribute, should only be used during analysis or for debugging.

    dataType

    The DataType of this attribute.

    nullable

    True if null is a valid value for this attribute.

    metadata

    The metadata of this attribute.

    exprId

    A globally unique id used to check if different AttributeReferences refer to the same attribute.

    qualifiers

    a list of strings that can be used to referred to this attribute in a fully qualified way. Consider the examples tableName.name, subQueryAlias.name. tableName and subQueryAlias are possible qualifiers.

  26. class AttributeSet extends Traversable[Attribute] with Serializable

    Permalink

    A Set designed to hold AttributeReference objects, that performs equality checking using expression id instead of standard java equality.

    A Set designed to hold AttributeReference objects, that performs equality checking using expression id instead of standard java equality. Using expression id means that these sets will correctly test for membership, even when the AttributeReferences in question differ cosmetically (e.g., the names have different capitalizations).

    Note that we do not override equality for Attribute references as it is really weird when AttributeReference("a"...) == AttrributeReference("b", ...). This tactic leads to broken tests, and also makes doing transformations hard (we always try keep older trees instead of new ones when the transformation was a no-op).

  27. case class Average(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  28. case class AverageFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  29. case class Base64(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Converts the argument from binary to a base 64 string.

  30. trait BaseGenericInternalRow extends InternalRow

    Permalink

    An extended version of InternalRow that implements all special getters, toString and equals/hashCode by genericGet.

  31. case class Bin(child: Expression) extends UnaryExpression with Serializable with ImplicitCastInputTypes with Product

    Permalink
  32. abstract class BinaryArithmetic extends BinaryOperator

    Permalink
  33. abstract class BinaryComparison extends BinaryOperator with Predicate

    Permalink
  34. abstract class BinaryExpression extends Expression

    Permalink

    An expression with two inputs and one output.

    An expression with two inputs and one output. The output is by default evaluated to null if any input is evaluated to null.

  35. abstract class BinaryMathExpression extends BinaryExpression with Serializable with ImplicitCastInputTypes

    Permalink

    A binary expression specifically for math functions that take two Doubles as input and returns a Double.

  36. abstract class BinaryOperator extends BinaryExpression with ExpectsInputTypes

    Permalink

    A BinaryExpression that is an operator, with two properties:

    A BinaryExpression that is an operator, with two properties:

    1. The string representation is "x symbol y", rather than "funcName(x, y)". 2. Two inputs are expected to the be same type. If the two inputs have different types, the analyzer will find the tightest common type and do the proper type casting.

  37. case class BitwiseAnd(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink

    A function that calculates bitwise and(&) of two numbers.

    A function that calculates bitwise and(&) of two numbers.

    Code generation inherited from BinaryArithmetic.

  38. case class BitwiseNot(child: Expression) extends UnaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    A function that calculates bitwise not(~) of a number.

  39. case class BitwiseOr(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink

    A function that calculates bitwise or(|) of two numbers.

    A function that calculates bitwise or(|) of two numbers.

    Code generation inherited from BinaryArithmetic.

  40. case class BitwiseXor(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink

    A function that calculates bitwise xor of two numbers.

    A function that calculates bitwise xor of two numbers.

    Code generation inherited from BinaryArithmetic.

  41. case class BoundReference(ordinal: Int, dataType: DataType, nullable: Boolean) extends LeafExpression with NamedExpression with Product with Serializable

    Permalink

    A bound reference points to a specific slot in the input tuple, allowing the actual value to be retrieved more efficiently.

    A bound reference points to a specific slot in the input tuple, allowing the actual value to be retrieved more efficiently. However, since operations like column pruning can change the layout of intermediate tuples, BindReferences should be run after all such transformations.

  42. case class CaseKeyWhen(key: Expression, branches: Seq[Expression]) extends Expression with CaseWhenLike with Product with Serializable

    Permalink

    Case statements of the form "CASE a WHEN b THEN c [WHEN d THEN e]* [ELSE f] END".

    Case statements of the form "CASE a WHEN b THEN c [WHEN d THEN e]* [ELSE f] END". Refer to this link for the corresponding semantics: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-ConditionalFunctions

  43. case class CaseWhen(branches: Seq[Expression]) extends Expression with CaseWhenLike with Product with Serializable

    Permalink

    Case statements of the form "CASE WHEN a THEN b [WHEN c THEN d]* [ELSE e] END".

    Case statements of the form "CASE WHEN a THEN b [WHEN c THEN d]* [ELSE e] END". Refer to this link for the corresponding semantics: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-ConditionalFunctions

  44. trait CaseWhenLike extends Expression

    Permalink
  45. case class Cast(child: Expression, dataType: DataType) extends UnaryExpression with CodegenFallback with Product with Serializable

    Permalink

    Cast the child expression to the target data type.

  46. case class Cbrt(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  47. case class Ceil(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  48. case class CheckOverflow(child: Expression, dataType: DecimalType) extends UnaryExpression with Product with Serializable

    Permalink

    Rounds the decimal to given scale and check whether the decimal can fit in provided precision or not, returns null if not.

  49. case class Coalesce(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    An expression that is evaluated to the first non-null input.

    An expression that is evaluated to the first non-null input.

    coalesce(1, 2) => 1
    coalesce(null, 1, 2) => 1
    coalesce(null, null, 2) => 2
    coalesce(null, null, null) => null
  50. case class CollectHashSet(expressions: Seq[Expression]) extends Expression with AggregateExpression1 with Product with Serializable

    Permalink
  51. case class CollectHashSetFunction(expr: Seq[Expression], base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  52. case class CombineSets(left: Expression, right: Expression) extends BinaryExpression with CodegenFallback with Product with Serializable

    Permalink

    Combines the elements of two sets.

    Combines the elements of two sets. For performance, this expression mutates its left input set during evaluation. Note: this expression is internal and created only by the GeneratedAggregate, we don't need to do type check for it.

  53. case class CombineSetsAndCount(inputSet: Expression) extends Expression with AggregateExpression1 with Product with Serializable

    Permalink
  54. case class CombineSetsAndCountFunction(inputSet: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  55. case class CombineSetsAndSum(inputSet: Expression, base: Expression) extends Expression with AggregateExpression1 with Product with Serializable

    Permalink
  56. case class CombineSetsAndSumFunction(inputSet: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  57. case class Concat(children: Seq[Expression]) extends Expression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    An expression that concatenates multiple input strings into a single string.

    An expression that concatenates multiple input strings into a single string. If any input is null, concat returns null.

  58. case class ConcatWs(children: Seq[Expression]) extends Expression with ImplicitCastInputTypes with CodegenFallback with Product with Serializable

    Permalink

    An expression that concatenates multiple input strings or array of strings into a single string, using a given separator (the first child).

    An expression that concatenates multiple input strings or array of strings into a single string, using a given separator (the first child).

    Returns null if the separator is null. Otherwise, concat_ws skips all null values.

  59. case class Contains(left: Expression, right: Expression) extends BinaryExpression with StringPredicate with Product with Serializable

    Permalink

    A function that returns true if the string left contains the string right.

  60. case class Conv(numExpr: Expression, fromBaseExpr: Expression, toBaseExpr: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Convert a num from one base to another

    Convert a num from one base to another

    numExpr

    the number to be converted

    fromBaseExpr

    from which base

    toBaseExpr

    to which base

  61. case class Cos(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  62. case class Cosh(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  63. case class Count(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  64. case class CountDistinct(expressions: Seq[Expression]) extends Expression with PartialAggregate1 with Product with Serializable

    Permalink
  65. case class CountDistinctFunction(expr: Seq[Expression], base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  66. case class CountFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  67. case class CountSet(child: Expression) extends UnaryExpression with CodegenFallback with Product with Serializable

    Permalink

    Returns the number of elements in the input set.

    Returns the number of elements in the input set. Note: this expression is internal and created only by the GeneratedAggregate, we don't need to do type check for it.

  68. case class Crc32(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function that computes a cyclic redundancy check value and returns it as a bigint For input of type BinaryType

  69. case class CreateArray(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    Returns an Array containing the evaluation of all children expressions.

  70. case class CreateNamedStruct(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    Creates a struct with the given field names and values

    Creates a struct with the given field names and values

    children

    Seq(name1, val1, name2, val2, ...)

  71. case class CreateNamedStructUnsafe(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    Creates a struct with the given field names and values.

    Creates a struct with the given field names and values. This is a variant that returns UnsafeRow directly. The unsafe projection operator replaces CreateStruct with this expression automatically at runtime.

    children

    Seq(name1, val1, name2, val2, ...)

  72. case class CreateStruct(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    Returns a Row containing the evaluation of all children expressions.

  73. case class CreateStructUnsafe(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    Returns a Row containing the evaluation of all children expressions.

    Returns a Row containing the evaluation of all children expressions. This is a variant that returns UnsafeRow directly. The unsafe projection operator replaces CreateStruct with this expression automatically at runtime.

  74. case class CurrentDate() extends LeafExpression with CodegenFallback with Product with Serializable

    Permalink

    Returns the current date at the start of query evaluation.

    Returns the current date at the start of query evaluation. All calls of current_date within the same query return the same value.

    There is no code generation since this expression should get constant folded by the optimizer.

  75. case class CurrentTimestamp() extends LeafExpression with CodegenFallback with Product with Serializable

    Permalink

    Returns the current timestamp at the start of query evaluation.

    Returns the current timestamp at the start of query evaluation. All calls of current_timestamp within the same query return the same value.

    There is no code generation since this expression should get constant folded by the optimizer.

  76. case class DateAdd(startDate: Expression, days: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Adds a number of days to startdate.

  77. case class DateDiff(endDate: Expression, startDate: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the number of days from startDate to endDate.

  78. case class DateFormatClass(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  79. case class DateSub(startDate: Expression, days: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Subtracts a number of days to startdate.

  80. case class DayOfMonth(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  81. case class DayOfYear(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  82. case class Decode(bin: Expression, charset: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Decodes the first argument into a String using the provided character set (one of 'US-ASCII', 'ISO-8859-1', 'UTF-8', 'UTF-16BE', 'UTF-16LE', 'UTF-16').

    Decodes the first argument into a String using the provided character set (one of 'US-ASCII', 'ISO-8859-1', 'UTF-8', 'UTF-16BE', 'UTF-16LE', 'UTF-16'). If either argument is null, the result will also be null.

  83. case class Divide(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  84. case class Encode(value: Expression, charset: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Encodes the first argument into a BINARY using the provided character set (one of 'US-ASCII', 'ISO-8859-1', 'UTF-8', 'UTF-16BE', 'UTF-16LE', 'UTF-16').

    Encodes the first argument into a BINARY using the provided character set (one of 'US-ASCII', 'ISO-8859-1', 'UTF-8', 'UTF-16BE', 'UTF-16LE', 'UTF-16'). If either argument is null, the result will also be null.

  85. case class EndsWith(left: Expression, right: Expression) extends BinaryExpression with StringPredicate with Product with Serializable

    Permalink

    A function that returns true if the string left ends with the string right.

  86. case class EqualNullSafe(left: Expression, right: Expression) extends BinaryComparison with Product with Serializable

    Permalink
  87. case class EqualTo(left: Expression, right: Expression) extends BinaryComparison with Product with Serializable

    Permalink
  88. case class EulerNumber() extends LeafMathExpression with Product with Serializable

    Permalink

    Euler's number.

    Euler's number. Note that there is no code generation because this is only evaluated by the optimizer during constant folding.

  89. case class Exp(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  90. trait ExpectsInputTypes extends Expression

    Permalink

    An trait that gets mixin to define the expected input types of an expression.

    An trait that gets mixin to define the expected input types of an expression.

    This trait is typically used by operator expressions (e.g. Add, Subtract) to define expected input types without any implicit casting.

    Most function expressions (e.g. Substring should extends ImplicitCastInputTypes) instead.

  91. case class Explode(child: Expression) extends UnaryExpression with Generator with CodegenFallback with Product with Serializable

    Permalink

    Given an input array produces a sequence of rows for each value in the array.

  92. case class Expm1(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  93. case class ExprId(id: Long) extends Product with Serializable

    Permalink

    A globally unique (within this JVM) id for a given named expression.

    A globally unique (within this JVM) id for a given named expression. Used to identify which attribute output by a relation is being referenced in a subsequent computation.

  94. abstract class Expression extends TreeNode[Expression]

    Permalink

    An expression in Catalyst.

    An expression in Catalyst.

    If an expression wants to be exposed in the function registry (so users can call it with "name(arguments...)", the concrete implementation must be a case class whose constructor arguments are all Expressions types. See Substring for an example.

    There are a few important traits:

    - Nondeterministic: an expression that is not deterministic. - Unevaluable: an expression that is not supposed to be evaluated. - CodegenFallback: an expression that does not have code gen implemented and falls back to interpreted mode.

    - LeafExpression: an expression that has no child. - UnaryExpression: an expression that has one child. - BinaryExpression: an expression that has two children. - BinaryOperator: a special case of BinaryExpression that requires two children to have the same output data type.

  95. class ExpressionDescription extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  96. class ExpressionInfo extends AnyRef

    Permalink
  97. case class Factorial(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  98. case class FindInSet(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function that returns the index (1-based) of the given string (left) in the comma- delimited list (right).

    A function that returns the index (1-based) of the given string (left) in the comma- delimited list (right). Returns 0, if the string wasn't found or if the given string (left) contains a comma.

  99. case class First(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  100. case class FirstFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  101. case class Floor(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  102. case class FormatNumber(x: Expression, d: Expression) extends BinaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    Formats the number X to a format like '#,###,###.##', rounded to D decimal places, and returns the result as a string.

    Formats the number X to a format like '#,###,###.##', rounded to D decimal places, and returns the result as a string. If D is 0, the result has no decimal point or fractional part.

  103. case class FormatString(children: Expression*) extends Expression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the input formatted according do printf-style format strings

  104. sealed trait FrameBoundary extends AnyRef

    Permalink

    The trait used to represent the type of a Window Frame Boundary.

  105. sealed trait FrameType extends AnyRef

    Permalink

    The trait used to represent the type of a Window Frame.

  106. case class FromUTCTimestamp(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Assumes given timestamp is UTC and converts to given timezone.

  107. case class FromUnixTime(sec: Expression, format: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Converts the number of seconds from unix epoch (1970-01-01 00:00:00 UTC) to a string representing the timestamp of that moment in the current system time zone in the given format.

    Converts the number of seconds from unix epoch (1970-01-01 00:00:00 UTC) to a string representing the timestamp of that moment in the current system time zone in the given format. If the format is missing, using format like "1970-01-01 00:00:00". Note that hive Language Manual says it returns 0 if fail, but in fact it returns null.

  108. trait Generator extends Expression

    Permalink

    An expression that produces zero or more rows given a single input row.

    An expression that produces zero or more rows given a single input row.

    Generators produce multiple output rows instead of a single value like other expressions, and thus they must have a schema to associate with the rows that are output.

    However, unlike row producing relational operators, which are either leaves or determine their output schema functionally from their input, generators can contain other expressions that might result in their modification by rules. This structure means that they might be copied multiple times after first determining their output schema. If a new output schema is created for each copy references up the tree might be rendered invalid. As a result generators must instead define a function makeOutput which is called only once when the schema is first requested. The attributes produced by this function will be automatically copied anytime rules result in changes to the Generator or its children.

  109. class GenericInternalRow extends InternalRow with BaseGenericInternalRow

    Permalink

    A internal row implementation that uses an array of objects as the underlying storage.

    A internal row implementation that uses an array of objects as the underlying storage. Note that, while the array is not copied, and thus could technically be mutated after creation, this is not allowed.

  110. class GenericInternalRowWithSchema extends GenericInternalRow

    Permalink

    This is used for serialization of Python DataFrame

  111. class GenericMutableRow extends MutableRow with BaseGenericInternalRow

    Permalink
  112. class GenericRow extends Row

    Permalink

    A row implementation that uses an array of objects as the underlying storage.

    A row implementation that uses an array of objects as the underlying storage. Note that, while the array is not copied, and thus could technically be mutated after creation, this is not allowed.

  113. class GenericRowWithSchema extends GenericRow

    Permalink
  114. case class GetArrayItem(child: Expression, ordinal: Expression) extends BinaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    Returns the field at ordinal in the Array child.

    Returns the field at ordinal in the Array child.

    We need to do type checking here as ordinal expression maybe unresolved.

  115. case class GetArrayStructFields(child: Expression, field: StructField, ordinal: Int, numFields: Int, containsNull: Boolean) extends UnaryExpression with Product with Serializable

    Permalink

    Returns the array of value of fields in the Array of Struct child.

    Returns the array of value of fields in the Array of Struct child.

    No need to do type checking since it is handled by ExtractValue.

  116. case class GetJsonObject(json: Expression, path: Expression) extends BinaryExpression with ExpectsInputTypes with CodegenFallback with Product with Serializable

    Permalink

    Extracts json object from a json string based on json path specified, and returns json string of the extracted json object.

    Extracts json object from a json string based on json path specified, and returns json string of the extracted json object. It will return null if the input json string is invalid.

  117. case class GetMapValue(child: Expression, key: Expression) extends BinaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    Returns the value of key key in Map child.

    Returns the value of key key in Map child.

    We need to do type checking here as key expression maybe unresolved.

  118. case class GetStructField(child: Expression, field: StructField, ordinal: Int) extends UnaryExpression with Product with Serializable

    Permalink

    Returns the value of fields in the Struct child.

    Returns the value of fields in the Struct child.

    No need to do type checking since it is handled by ExtractValue.

  119. case class GreaterThan(left: Expression, right: Expression) extends BinaryComparison with Product with Serializable

    Permalink
  120. case class GreaterThanOrEqual(left: Expression, right: Expression) extends BinaryComparison with Product with Serializable

    Permalink
  121. case class Greatest(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    A function that returns the greatest value of all parameters, skipping null values.

    A function that returns the greatest value of all parameters, skipping null values. It takes at least 2 parameters, and returns null iff all parameters are null.

  122. case class Hex(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    If the argument is an INT or binary, hex returns the number as a STRING in hexadecimal format.

    If the argument is an INT or binary, hex returns the number as a STRING in hexadecimal format. Otherwise if the number is a STRING, it converts each character into its hex representation and returns the resulting STRING. Negative numbers would be treated as two's complement.

  123. case class Hour(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  124. case class Hypot(left: Expression, right: Expression) extends BinaryMathExpression with Product with Serializable

    Permalink
  125. case class If(predicate: Expression, trueValue: Expression, falseValue: Expression) extends Expression with Product with Serializable

    Permalink
  126. trait ImplicitCastInputTypes extends Expression with ExpectsInputTypes

    Permalink

    A mixin for the analyzer to perform implicit type casting using ImplicitTypeCasts.

  127. case class In(value: Expression, list: Seq[Expression]) extends Expression with Predicate with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Evaluates to true if list contains value.

  128. case class InSet(child: Expression, hset: Set[Any]) extends UnaryExpression with Predicate with Product with Serializable

    Permalink

    Optimized version of In clause, when all filter values of In clause are static.

  129. case class InitCap(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns string, with the first letter of each word in uppercase.

    Returns string, with the first letter of each word in uppercase. Words are delimited by whitespace.

  130. case class InputFileName() extends LeafExpression with Nondeterministic with Product with Serializable

    Permalink

    Expression that returns the name of the current file being read in using SqlNewHadoopRDD

  131. case class InterpretedMutableProjection(expressions: Seq[Expression]) extends MutableProjection with Product with Serializable

    Permalink

    A MutableProjection that is calculated by calling eval on each of the specified expressions.

    A MutableProjection that is calculated by calling eval on each of the specified expressions.

    expressions

    a sequence of expressions that determine the value of each column of the output row.

  132. class InterpretedOrdering extends Ordering[InternalRow]

    Permalink

    An interpreted row ordering comparator.

  133. class InterpretedProjection extends Projection

    Permalink

    A Projection that is calculated by calling the eval of each of the specified expressions.

  134. case class IsNaN(child: Expression) extends UnaryExpression with Predicate with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Evaluates to true iff it's NaN.

  135. case class IsNotNull(child: Expression) extends UnaryExpression with Predicate with Product with Serializable

    Permalink

    An expression that is evaluated to true if the input is not null.

  136. case class IsNull(child: Expression) extends UnaryExpression with Predicate with Product with Serializable

    Permalink

    An expression that is evaluated to true if the input is null.

  137. class JoinedRow extends InternalRow

    Permalink

    A mutable wrapper that makes two rows appear as a single concatenated row.

    A mutable wrapper that makes two rows appear as a single concatenated row. Designed to be instantiated once per thread and reused.

  138. case class Last(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  139. case class LastDay(startDate: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the last day of the month which the date belongs to.

  140. case class LastFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  141. abstract class LeafExpression extends Expression

    Permalink

    A leaf expression, i.e.

    A leaf expression, i.e. one without any child expressions.

  142. abstract class LeafMathExpression extends LeafExpression with CodegenFallback

    Permalink

    A leaf expression specifically for math constants.

    A leaf expression specifically for math constants. Math constants expect no input.

    There is no code generation because they should get constant folded by the optimizer.

  143. case class Least(children: Seq[Expression]) extends Expression with Product with Serializable

    Permalink

    A function that returns the least value of all parameters, skipping null values.

    A function that returns the least value of all parameters, skipping null values. It takes at least 2 parameters, and returns null iff all parameters are null.

  144. case class Length(child: Expression) extends UnaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    A function that return the length of the given string or binary expression.

  145. case class LessThan(left: Expression, right: Expression) extends BinaryComparison with Product with Serializable

    Permalink
  146. case class LessThanOrEqual(left: Expression, right: Expression) extends BinaryComparison with Product with Serializable

    Permalink
  147. case class Levenshtein(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function that return the Levenshtein distance between the two given strings.

  148. case class Like(left: Expression, right: Expression) extends BinaryExpression with StringRegexExpression with CodegenFallback with Product with Serializable

    Permalink

    Simple RegEx pattern matching function

  149. case class Literal(value: Any, dataType: DataType) extends LeafExpression with CodegenFallback with Product with Serializable

    Permalink

    In order to do type checking, use Literal.create() instead of constructor

  150. case class Log(child: Expression) extends UnaryLogExpression with Product with Serializable

    Permalink
  151. case class Log10(child: Expression) extends UnaryLogExpression with Product with Serializable

    Permalink
  152. case class Log1p(child: Expression) extends UnaryLogExpression with Product with Serializable

    Permalink
  153. case class Log2(child: Expression) extends UnaryLogExpression with Product with Serializable

    Permalink
  154. case class Logarithm(left: Expression, right: Expression) extends BinaryMathExpression with Product with Serializable

    Permalink

    Computes the logarithm of a number.

    Computes the logarithm of a number.

    left

    the logarithm base, default to e.

    right

    the number to compute the logarithm of.

  155. case class Lower(child: Expression) extends UnaryExpression with String2StringExpression with Product with Serializable

    Permalink

    A function that converts the characters of a string to lowercase.

    A function that converts the characters of a string to lowercase.

    Annotations
    @ExpressionDescription()
  156. case class MakeDecimal(child: Expression, precision: Int, scale: Int) extends UnaryExpression with Product with Serializable

    Permalink

    Create a Decimal from an unscaled Long value.

    Create a Decimal from an unscaled Long value. Note: this expression is internal and created only by the optimizer, we don't need to do type check for it.

  157. case class Max(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  158. case class MaxFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  159. case class MaxOf(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  160. case class Md5(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function that calculates an MD5 128-bit checksum and returns it as a hex string For input of type BinaryType

  161. case class Min(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  162. case class MinFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  163. case class MinOf(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  164. case class Minute(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  165. case class Month(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  166. case class MonthsBetween(date1: Expression, date2: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns number of months between dates date1 and date2.

  167. case class Multiply(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  168. final class MutableAny extends MutableValue

    Permalink
  169. final class MutableBoolean extends MutableValue

    Permalink
  170. final class MutableByte extends MutableValue

    Permalink
  171. final class MutableDouble extends MutableValue

    Permalink
  172. final class MutableFloat extends MutableValue

    Permalink
  173. final class MutableInt extends MutableValue

    Permalink
  174. case class MutableLiteral(value: Any, dataType: DataType, nullable: Boolean = true) extends LeafExpression with CodegenFallback with Product with Serializable

    Permalink
  175. final class MutableLong extends MutableValue

    Permalink
  176. abstract class MutableProjection extends Projection

    Permalink

    Converts a InternalRow to another Row given a sequence of expression that define each column of the new row.

    Converts a InternalRow to another Row given a sequence of expression that define each column of the new row. If the schema of the input row is specified, then the given expression will be bound to that schema.

    In contrast to a normal projection, a MutableProjection reuses the same underlying row object each time an input row is added. This significantly reduces the cost of calculating the projection, but means that it is not safe to hold on to a reference to a InternalRow after next() has been called on the Iterator that produced it. Instead, the user must call InternalRow.copy() and hold on to the returned InternalRow before calling next().

  177. abstract class MutableRow extends InternalRow

    Permalink

    An extended interface to InternalRow that allows the values for each column to be updated.

    An extended interface to InternalRow that allows the values for each column to be updated. Setting a value through a primitive function implicitly marks that column as not null.

  178. final class MutableShort extends MutableValue

    Permalink
  179. abstract class MutableValue extends Serializable

    Permalink

    A parent class for mutable container objects that are reused when the values are changed, resulting in less garbage.

    A parent class for mutable container objects that are reused when the values are changed, resulting in less garbage. These values are held by a SpecificMutableRow.

    The following code was roughly used to generate these objects:

    val types = "Int,Float,Boolean,Double,Short,Long,Byte,Any".split(",")
    types.map {tpe =>
    s"""
    final class Mutable$tpe extends MutableValue {
      var value: $tpe = 0
      def boxed = if (isNull) null else value
      def update(v: Any) = value = {
        isNull = false
        v.asInstanceOf[$tpe]
      }
      def copy() = {
        val newCopy = new Mutable$tpe
        newCopy.isNull = isNull
        newCopy.value = value
        newCopy.asInstanceOf[this.type]
      }
    }"""
    }.foreach(println)
    
    types.map { tpe =>
    s"""
      override def set$tpe(ordinal: Int, value: $tpe): Unit = {
        val currentValue = values(ordinal).asInstanceOf[Mutable$tpe]
        currentValue.isNull = false
        currentValue.value = value
      }
    
      override def get$tpe(i: Int): $tpe = {
        values(i).asInstanceOf[Mutable$tpe].value
      }"""
    }.foreach(println)
  180. case class NaNvl(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    An Expression evaluates to left iff it's not NaN, or evaluates to right otherwise.

    An Expression evaluates to left iff it's not NaN, or evaluates to right otherwise. This Expression is useful for mapping NaN values to null.

  181. trait NamedExpression extends Expression

    Permalink

    An Expression that is named.

  182. case class NewSet(elementType: DataType) extends LeafExpression with CodegenFallback with Product with Serializable

    Permalink

    Creates a new set of the specified type

  183. case class NextDay(startDate: Expression, dayOfWeek: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the first date which is later than startDate and named as dayOfWeek.

    Returns the first date which is later than startDate and named as dayOfWeek. For example, NextDay(2015-07-27, Sunday) would return 2015-08-02, which is the first Sunday later than 2015-07-27.

    Allowed "dayOfWeek" is defined in DateTimeUtils.getDayOfWeekFromString.

  184. trait Nondeterministic extends Expression

    Permalink

    An expression that is nondeterministic.

  185. case class Not(child: Expression) extends UnaryExpression with Predicate with ImplicitCastInputTypes with Product with Serializable

    Permalink
  186. case class Or(left: Expression, right: Expression) extends BinaryOperator with Predicate with Product with Serializable

    Permalink
  187. trait PartialAggregate1 extends Expression with AggregateExpression1

    Permalink

    An AggregateExpression1 that can be partially computed without seeing all relevant tuples.

    An AggregateExpression1 that can be partially computed without seeing all relevant tuples. These partial evaluations can then be combined to compute the actual answer.

  188. case class Pi() extends LeafMathExpression with Product with Serializable

    Permalink

    Pi.

    Pi. Note that there is no code generation because this is only evaluated by the optimizer during constant folding.

  189. case class Pmod(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  190. case class Pow(left: Expression, right: Expression) extends BinaryMathExpression with Product with Serializable

    Permalink
  191. trait Predicate extends Expression

    Permalink

    An Expression that returns a boolean value.

  192. trait PredicateHelper extends AnyRef

    Permalink
  193. case class PrettyAttribute(name: String) extends Attribute with Unevaluable with Product with Serializable

    Permalink

    A place holder used when printing expressions without debugging information such as the expression id or the unresolved indicator.

  194. abstract class Projection extends (InternalRow) ⇒ InternalRow

    Permalink

    Converts a InternalRow to another Row given a sequence of expression that define each column of the new row.

    Converts a InternalRow to another Row given a sequence of expression that define each column of the new row. If the schema of the input row is specified, then the given expression will be bound to that schema.

  195. case class PromotePrecision(child: Expression) extends UnaryExpression with Product with Serializable

    Permalink

    An expression used to wrap the children when promote the precision of DecimalType to avoid promote multiple times.

  196. case class Quarter(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  197. abstract class RDG extends LeafExpression with Nondeterministic

    Permalink

    A Random distribution generating expression.

    A Random distribution generating expression. TODO: This can be made generic to generate any type of random distribution, or any type of StructType.

    Since this expression is stateful, it cannot be a case object.

  198. case class RLike(left: Expression, right: Expression) extends BinaryExpression with StringRegexExpression with CodegenFallback with Product with Serializable

    Permalink
  199. case class Rand(seed: Long) extends RDG with Product with Serializable

    Permalink

    Generate a random column with i.i.d.

    Generate a random column with i.i.d. uniformly distributed values in [0, 1).

  200. case class Randn(seed: Long) extends RDG with Product with Serializable

    Permalink

    Generate a random column with i.i.d.

    Generate a random column with i.i.d. gaussian random distribution.

  201. case class RegExpExtract(subject: Expression, regexp: Expression, idx: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Extract a specific(idx) group identified by a Java regex.

    Extract a specific(idx) group identified by a Java regex.

    NOTE: this expression is not THREAD-SAFE, as it has some internal mutable status.

  202. case class RegExpReplace(subject: Expression, regexp: Expression, rep: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Replace all substrings of str that match regexp with rep.

    Replace all substrings of str that match regexp with rep.

    NOTE: this expression is not THREAD-SAFE, as it has some internal mutable status.

  203. case class Remainder(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  204. case class Rint(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  205. case class Round(child: Expression, scale: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Round the child's result to scale decimal place when scale >= 0 or round at integral part when scale < 0.

    Round the child's result to scale decimal place when scale >= 0 or round at integral part when scale < 0. For example, round(31.415, 2) = 31.42 and round(31.415, -1) = 30.

    Child of IntegralType would round to itself when scale >= 0. Child of FractionalType whose value is NaN or Infinite would always round to itself.

    Round's dataType would always equal to child's dataType except for DecimalType, which would lead scale decrease from the origin DecimalType.

    child

    expr to be round, all NumericType is allowed as Input

    scale

    new scale to be round to, this should be a constant int at runtime

  206. case class ScalaUDF(function: AnyRef, dataType: DataType, children: Seq[Expression], inputTypes: Seq[DataType] = Nil) extends Expression with ImplicitCastInputTypes with CodegenFallback with Product with Serializable

    Permalink

    User-defined function.

    User-defined function.

    dataType

    Return type of function.

  207. case class Second(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  208. case class Sha1(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function that calculates a sha1 hash value and returns it as a hex string For input of type BinaryType or StringType

  209. case class Sha2(left: Expression, right: Expression) extends BinaryExpression with Serializable with ImplicitCastInputTypes with Product

    Permalink

    A function that calculates the SHA-2 family of functions (SHA-224, SHA-256, SHA-384, and SHA-512) and returns it as a hex string.

    A function that calculates the SHA-2 family of functions (SHA-224, SHA-256, SHA-384, and SHA-512) and returns it as a hex string. The first argument is the string or binary to be hashed. The second argument indicates the desired bit length of the result, which must have a value of 224, 256, 384, 512, or 0 (which is equivalent to 256). SHA-224 is supported starting from Java 8. If asking for an unsupported SHA function, the return value is NULL. If either argument is NULL or the hash length is not one of the permitted values, the return value is NULL.

  210. case class ShiftLeft(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Bitwise unsigned left shift.

    Bitwise unsigned left shift.

    left

    the base number to shift.

    right

    number of bits to left shift.

  211. case class ShiftRight(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Bitwise unsigned left shift.

    Bitwise unsigned left shift.

    left

    the base number to shift.

    right

    number of bits to left shift.

  212. case class ShiftRightUnsigned(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Bitwise unsigned right shift, for integer and long data type.

    Bitwise unsigned right shift, for integer and long data type.

    left

    the base number.

    right

    the number of bits to right shift.

  213. case class Signum(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  214. case class Sin(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  215. case class Sinh(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  216. case class Size(child: Expression) extends UnaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    Given an array or map, returns its size.

  217. case class SortArray(base: Expression, ascendingOrder: Expression) extends BinaryExpression with ExpectsInputTypes with CodegenFallback with Product with Serializable

    Permalink

    Sorts the input array in ascending / descending order according to the natural ordering of the array elements and returns it.

  218. sealed abstract class SortDirection extends AnyRef

    Permalink
  219. case class SortOrder(child: Expression, direction: SortDirection) extends UnaryExpression with Unevaluable with Product with Serializable

    Permalink

    An expression that can be used to sort a tuple.

    An expression that can be used to sort a tuple. This class extends expression primarily so that transformations over expression will descend into its child.

  220. case class SortPrefix(child: SortOrder) extends UnaryExpression with Product with Serializable

    Permalink

    An expression to generate a 64-bit long prefix used in sorting.

  221. case class SoundEx(child: Expression) extends UnaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    A function that return soundex code of the given string expression.

  222. trait SpecializedGetters extends AnyRef

    Permalink
  223. final class SpecificMutableRow extends MutableRow with BaseGenericInternalRow

    Permalink

    A row type that holds an array specialized container objects, of type MutableValue, chosen based on the dataTypes of each column.

    A row type that holds an array specialized container objects, of type MutableValue, chosen based on the dataTypes of each column. The intent is to decrease garbage when modifying the values of primitive columns.

  224. case class SpecifiedWindowFrame(frameType: FrameType, frameStart: FrameBoundary, frameEnd: FrameBoundary) extends WindowFrame with Product with Serializable

    Permalink

    A specified Window Frame.

  225. case class SplitEvaluation(finalEvaluation: Expression, partialEvaluations: Seq[NamedExpression]) extends Product with Serializable

    Permalink

    Represents an aggregation that has been rewritten to be performed in two steps.

    Represents an aggregation that has been rewritten to be performed in two steps.

    finalEvaluation

    an aggregate expression that evaluates to same final result as the original aggregation.

    partialEvaluations

    A sequence of NamedExpressions that can be computed on partial data sets and are required to compute the finalEvaluation.

  226. case class Sqrt(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  227. case class StartsWith(left: Expression, right: Expression) extends BinaryExpression with StringPredicate with Product with Serializable

    Permalink

    A function that returns true if the string left starts with the string right.

  228. trait String2StringExpression extends Expression with ImplicitCastInputTypes

    Permalink
  229. case class StringInstr(str: Expression, substr: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function that returns the position of the first occurrence of substr in the given string.

    A function that returns the position of the first occurrence of substr in the given string. Returns null if either of the arguments are null and returns 0 if substr could not be found in str.

    NOTE: that this is not zero based, but 1-based index. The first character in str has index 1.

  230. case class StringLPad(str: Expression, len: Expression, pad: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns str, left-padded with pad to a length of len.

  231. case class StringLocate(substr: Expression, str: Expression, start: Expression) extends TernaryExpression with ImplicitCastInputTypes with CodegenFallback with Product with Serializable

    Permalink

    A function that returns the position of the first occurrence of substr in given string after position pos.

  232. trait StringPredicate extends Expression with Predicate with ImplicitCastInputTypes

    Permalink

    A base trait for functions that compare two strings, returning a boolean.

  233. case class StringRPad(str: Expression, len: Expression, pad: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns str, right-padded with pad to a length of len.

  234. trait StringRegexExpression extends Expression with ImplicitCastInputTypes

    Permalink
  235. case class StringRepeat(str: Expression, times: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the string which repeat the given string value n times.

  236. case class StringReverse(child: Expression) extends UnaryExpression with String2StringExpression with Product with Serializable

    Permalink

    Returns the reversed given string.

  237. case class StringSpace(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns a n spaces string.

  238. case class StringSplit(str: Expression, pattern: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Splits str around pat (pattern is a regular expression).

  239. case class StringTranslate(srcExpr: Expression, matchingExpr: Expression, replaceExpr: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function translate any character in the srcExpr by a character in replaceExpr.

    A function translate any character in the srcExpr by a character in replaceExpr. The characters in replaceExpr is corresponding to the characters in matchingExpr. The translate will happen when any character in the string matching with the character in the matchingExpr.

  240. case class StringTrim(child: Expression) extends UnaryExpression with String2StringExpression with Product with Serializable

    Permalink

    A function that trim the spaces from both ends for the specified string.

  241. case class StringTrimLeft(child: Expression) extends UnaryExpression with String2StringExpression with Product with Serializable

    Permalink

    A function that trim the spaces from left end for given string.

  242. case class StringTrimRight(child: Expression) extends UnaryExpression with String2StringExpression with Product with Serializable

    Permalink

    A function that trim the spaces from right end for given string.

  243. case class Substring(str: Expression, pos: Expression, len: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    A function that takes a substring of its first argument starting at a given position.

    A function that takes a substring of its first argument starting at a given position. Defined for String and Binary types.

  244. case class SubstringIndex(strExpr: Expression, delimExpr: Expression, countExpr: Expression) extends TernaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the substring from string str before count occurrences of the delimiter delim.

    Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything the left of the final delimiter (counting from left) is returned. If count is negative, every to the right of the final delimiter (counting from the right) is returned. substring_index performs a case-sensitive match when searching for delim.

  245. case class Subtract(left: Expression, right: Expression) extends BinaryArithmetic with Product with Serializable

    Permalink
  246. case class Sum(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  247. case class SumDistinct(child: Expression) extends UnaryExpression with PartialAggregate1 with Product with Serializable

    Permalink
  248. case class SumDistinctFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  249. case class SumFunction(expr: Expression, base: AggregateExpression1) extends AggregateFunction1 with Product with Serializable

    Permalink
  250. case class Tan(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  251. case class Tanh(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  252. abstract class TernaryExpression extends Expression

    Permalink

    An expression with three inputs and one output.

    An expression with three inputs and one output. The output is by default evaluated to null if any input is evaluated to null.

  253. case class TimeAdd(start: Expression, interval: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Adds an interval to timestamp.

  254. case class TimeSub(start: Expression, interval: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Subtracts an interval from timestamp.

  255. case class ToDate(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns the date part of a timestamp or string.

  256. case class ToDegrees(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  257. case class ToRadians(child: Expression) extends UnaryMathExpression with Product with Serializable

    Permalink
  258. case class ToUTCTimestamp(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Assumes given timestamp is in given timezone and converts to UTC.

  259. case class TruncDate(date: Expression, format: Expression) extends BinaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Returns date truncated to the unit specified by the format.

  260. case class UnBase64(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Converts the argument from a base 64 string to BINARY.

  261. abstract class UnaryExpression extends Expression

    Permalink

    An expression with one input and one output.

    An expression with one input and one output. The output is by default evaluated to null if the input is evaluated to null.

  262. abstract class UnaryLogExpression extends UnaryMathExpression

    Permalink
  263. abstract class UnaryMathExpression extends UnaryExpression with Serializable with ImplicitCastInputTypes

    Permalink

    A unary expression specifically for math functions.

    A unary expression specifically for math functions. Math Functions expect a specific type of input format, therefore these functions extend ExpectsInputTypes.

  264. case class UnaryMinus(child: Expression) extends UnaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink
  265. case class UnaryPositive(child: Expression) extends UnaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink
  266. trait Unevaluable extends Expression

    Permalink

    An expression that cannot be evaluated.

    An expression that cannot be evaluated. Some expressions don't live past analysis or optimization time (e.g. Star). This trait is used by those expressions.

  267. case class Unhex(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

    Performs the inverse operation of HEX.

    Performs the inverse operation of HEX. Resulting characters are returned as a byte array.

  268. case class UnixTimestamp(timeExp: Expression, format: Expression) extends BinaryExpression with ExpectsInputTypes with Product with Serializable

    Permalink

    Converts time string with given pattern (see [http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html]) to Unix time stamp (in seconds), returns null if fail.

    Converts time string with given pattern (see [http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html]) to Unix time stamp (in seconds), returns null if fail. Note that hive Language Manual says it returns 0 if fail, but in fact it returns null. If the second parameter is missing, use "yyyy-MM-dd HH:mm:ss". If no parameters provided, the first parameter will be current_timestamp. If the first parameter is a Date or Timestamp instead of String, we will ignore the second parameter.

  269. case class UnresolvedWindowExpression(child: UnresolvedWindowFunction, windowSpec: WindowSpecReference) extends UnaryExpression with Unevaluable with Product with Serializable

    Permalink
  270. case class UnresolvedWindowFunction(name: String, children: Seq[Expression]) extends Expression with WindowFunction with Unevaluable with Product with Serializable

    Permalink
  271. class UnsafeArrayData extends ArrayData

    Permalink
  272. class UnsafeMapData extends MapData

    Permalink
  273. abstract class UnsafeProjection extends Projection

    Permalink

    A projection that returns UnsafeRow.

  274. class UnsafeReaders extends AnyRef

    Permalink
  275. final class UnsafeRow extends MutableRow

    Permalink
  276. class UnsafeRowWriters extends AnyRef

    Permalink
  277. class UnsafeWriters extends AnyRef

    Permalink
  278. case class UnscaledValue(child: Expression) extends UnaryExpression with Product with Serializable

    Permalink

    Return the unscaled Long value of a Decimal, assuming it fits in a Long.

    Return the unscaled Long value of a Decimal, assuming it fits in a Long. Note: this expression is internal and created only by the optimizer, we don't need to do type check for it.

  279. case class Upper(child: Expression) extends UnaryExpression with String2StringExpression with Product with Serializable

    Permalink

    A function that converts the characters of a string to uppercase.

    A function that converts the characters of a string to uppercase.

    Annotations
    @ExpressionDescription()
  280. case class UserDefinedGenerator(elementTypes: Seq[(DataType, Boolean)], function: (Row) ⇒ TraversableOnce[InternalRow], children: Seq[Expression]) extends Expression with Generator with CodegenFallback with Product with Serializable

    Permalink

    A generator that produces its output using the provided lambda function.

  281. case class ValueFollowing(value: Int) extends FrameBoundary with Product with Serializable

    Permalink

    <value> FOLLOWING boundary.

  282. case class ValuePreceding(value: Int) extends FrameBoundary with Product with Serializable

    Permalink

    <value> PRECEDING boundary.

  283. case class WeekOfYear(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink
  284. case class WindowExpression(windowFunction: WindowFunction, windowSpec: WindowSpecDefinition) extends Expression with Unevaluable with Product with Serializable

    Permalink
  285. sealed trait WindowFrame extends AnyRef

    Permalink

    The trait used to represent the a Window Frame.

  286. trait WindowFunction extends Expression

    Permalink

    Every window function needs to maintain a output buffer for its output.

    Every window function needs to maintain a output buffer for its output. It should expect that for a n-row window frame, it will be called n times to retrieve value corresponding with these n rows.

  287. sealed trait WindowSpec extends AnyRef

    Permalink

    The trait of the Window Specification (specified in the OVER clause or WINDOW clause) for Window Functions.

  288. case class WindowSpecDefinition(partitionSpec: Seq[Expression], orderSpec: Seq[SortOrder], frameSpecification: WindowFrame) extends Expression with WindowSpec with Unevaluable with Product with Serializable

    Permalink

    The specification for a window function.

    The specification for a window function.

    partitionSpec

    It defines the way that input rows are partitioned.

    orderSpec

    It defines the ordering of rows in a partition.

    frameSpecification

    It defines the window frame in a partition.

  289. case class WindowSpecReference(name: String) extends WindowSpec with Product with Serializable

    Permalink

    A Window specification reference that refers to the WindowSpecDefinition defined under the name name.

  290. case class Year(child: Expression) extends UnaryExpression with ImplicitCastInputTypes with Product with Serializable

    Permalink

Value Members

  1. object Ascending extends SortDirection with Product with Serializable

    Permalink
  2. object AttributeMap extends Serializable

    Permalink

    Builds a map that is keyed by an Attribute's expression id.

    Builds a map that is keyed by an Attribute's expression id. Using the expression id allows values to be looked up even when the attributes used differ cosmetically (i.e., the capitalization of the name, or the expected nullability).

  3. object AttributeSet extends Serializable

    Permalink
  4. object BindReferences extends Logging

    Permalink
  5. object Cast extends Serializable

    Permalink
  6. object CurrentRow extends FrameBoundary with Product with Serializable

    Permalink

    CURRENT ROW boundary.

  7. object Descending extends SortDirection with Product with Serializable

    Permalink
  8. val EmptyRow: InternalRow

    Permalink

    Used as input into expressions whose output does not depend on any input value.

  9. object ExtractValue

    Permalink
  10. object Factorial extends Serializable

    Permalink
  11. object FrameBoundaryExtractor

    Permalink

    Extractor for making working with frame boundaries easier.

  12. object FromUnsafeProjection

    Permalink

    A projection that could turn UnsafeRow into GenericInternalRow

  13. object Hex extends Serializable

    Permalink
  14. object IntegerLiteral

    Permalink

    Extractor for retrieving Int literals.

  15. object InterpretedOrdering extends Serializable

    Permalink
  16. object InterpretedPredicate

    Permalink
  17. object Literal extends Serializable

    Permalink
  18. object NamedExpression

    Permalink
  19. object NonNullLiteral

    Permalink

    An extractor that matches non-null literal values

  20. object RangeFrame extends FrameType with Product with Serializable

    Permalink

    RangeFrame treats rows in a partition as groups of peers.

    RangeFrame treats rows in a partition as groups of peers. All rows having the same ORDER BY ordering are considered as peers. When a ValuePreceding or a ValueFollowing is used as its FrameBoundary, the value is considered as a logical offset. For example, assuming the value of the current row's ORDER BY expression expr is v, RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING represents a frame containing rows whose values expr are in the range of [v-1, v+1].

    If ORDER BY clause is not defined, all rows in the partition is considered as peers of the current row.

  21. object RowFrame extends FrameType with Product with Serializable

    Permalink

    RowFrame treats rows in a partition individually.

    RowFrame treats rows in a partition individually. When a ValuePreceding or a ValueFollowing is used as its FrameBoundary, the value is considered as a physical offset. For example, ROW BETWEEN 1 PRECEDING AND 1 FOLLOWING represents a 3-row frame, from the row precedes the current row to the row follows the current row.

  22. object RowOrdering

    Permalink
  23. object SpecifiedWindowFrame extends Serializable

    Permalink
  24. object StringTranslate extends Serializable

    Permalink
  25. object Substring extends Serializable

    Permalink
  26. object UnboundedFollowing extends FrameBoundary with Product with Serializable

    Permalink

    UNBOUNDED FOLLOWING boundary.

  27. object UnboundedPreceding extends FrameBoundary with Product with Serializable

    Permalink

    UNBOUNDED PRECEDING boundary.

  28. object UnsafeProjection

    Permalink
  29. object UnspecifiedFrame extends WindowFrame with Product with Serializable

    Permalink

    Used as a place holder when a frame specification is not defined.

  30. object VirtualColumn

    Permalink
  31. package aggregate

    Permalink
  32. package codegen

    Permalink

    A collection of generators that build custom bytecode at runtime for performing the evaluation of catalyst expression.

Inherited from AnyRef

Inherited from Any

Ungrouped