Skip to content
Snippets Groups Projects
Commit 61c3cf79 authored by Reynold Xin's avatar Reynold Xin
Browse files

[SPARK-8879][SQL] Remove EmptyRow class.

As a baby step towards no megamorphic InternalRow.

Author: Reynold Xin <rxin@databricks.com>

Closes #7277 from rxin/remove-empty-row and squashes the following commits:

594100e [Reynold Xin] [SPARK-8879][SQL] Remove EmptyRow class.
parent 5d603dfe
No related branches found
No related tags found
No related merge requests found
......@@ -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"
}
......@@ -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
......@@ -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
......
......@@ -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.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment