Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/6869#discussion_r32703264
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/InternalRow.scala ---
@@ -19,39 +19,193 @@ package org.apache.spark.sql.catalyst
import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.expressions.GenericRow
+import org.apache.spark.sql.types.StructType
+import org.apache.spark.unsafe.types.UTF8String
/**
* An abstract class for row used internal in Spark SQL, which only
contain the columns as
* internal types.
+ *
+ * The following is a mapping between Spark SQL types and types of objects
in row:
+ *
+ * BooleanType -> java.lang.Boolean
+ * ByteType -> java.lang.Byte
+ * ShortType -> java.lang.Short
+ * IntegerType -> java.lang.Integer
+ * FloatType -> java.lang.Float
+ * DoubleType -> java.lang.Double
+ * StringType -> UTF8String
+ * DecimalType -> org.apache.spark.sql.types.Decimal
+ *
+ * DateType -> java.lang.Int
+ * TimestampType -> java.lang.Long
+ *
+ * BinaryType -> Array[Byte]
+ * ArrayType -> scala.collection.Seq
+ * MapType -> scala.collection.Map
+ * StructType -> InternalRow
*/
-abstract class InternalRow extends Row {
- // A default implementation to change the return type
- override def copy(): InternalRow = {this}
-}
+abstract class InternalRow extends Serializable {
+ /** Number of elements in the Row. */
+ def size: Int = length
-object InternalRow {
- def unapplySeq(row: InternalRow): Some[Seq[Any]] = Some(row.toSeq)
+ /** Number of elements in the Row. */
+ def length: Int
/**
- * This method can be used to construct a [[Row]] with the given values.
+ * Schema for the row.
*/
- def apply(values: Any*): InternalRow = new GenericRow(values.toArray)
+ def schema: StructType = null
--- End diff --
do we need this here?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]