Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,6 @@ case class CreateNamedStruct(children: Seq[Expression]) extends Expression {
override def eval(input: InternalRow): Any = {
InternalRow(valExprs.map(_.eval(input)): _*)
}

override def prettyName: String = "named_struct"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.spark.sql.catalyst

import org.apache.spark.sql.catalyst.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
Expand Down Expand Up @@ -49,6 +51,11 @@ package org.apache.spark.sql.catalyst
*/
package object expressions {

/**
* Used as input into expressions whose output does not depend on any input value.
*/
val EmptyRow: InternalRow = null

/**
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,6 @@ abstract class MutableRow extends InternalRow {
}
}

/**
* A row with no data. Calling any methods will result in an error. Can be used as a placeholder.
*/
object EmptyRow extends InternalRow {
override def apply(i: Int): Any = throw new UnsupportedOperationException
override def toSeq: Seq[Any] = Seq.empty
override def length: Int = 0
override def isNullAt(i: Int): Boolean = throw new UnsupportedOperationException
override def getInt(i: Int): Int = throw new UnsupportedOperationException
override def getLong(i: Int): Long = throw new UnsupportedOperationException
override def getDouble(i: Int): Double = throw new UnsupportedOperationException
override def getFloat(i: Int): Float = throw new UnsupportedOperationException
override def getBoolean(i: Int): Boolean = throw new UnsupportedOperationException
override def getShort(i: Int): Short = throw new UnsupportedOperationException
override def getByte(i: Int): Byte = throw new UnsupportedOperationException
override def getString(i: Int): String = throw new UnsupportedOperationException
override def getAs[T](i: Int): T = throw new UnsupportedOperationException
override def copy(): InternalRow = this
}

/**
* A row implementation that uses an array of objects as the underlying storage.
*/
Expand Down