Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/8971#discussion_r41352041
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/columnar/ColumnType.scala ---
@@ -399,24 +409,158 @@ private[sql] object BINARY extends
ByteArrayColumnType(16) {
override def getField(row: InternalRow, ordinal: Int): Array[Byte] = {
row.getBinary(ordinal)
}
+
+ def serialize(value: Array[Byte]): Array[Byte] = value
+ def deserialize(bytes: Array[Byte]): Array[Byte] = bytes
}
-// Used to process generic objects (all types other than those listed
above). Objects should be
-// serialized first before appending to the column `ByteBuffer`, and is
also extracted as serialized
-// byte array.
-private[sql] case class GENERIC(dataType: DataType) extends
ByteArrayColumnType(16) {
- override def setField(row: MutableRow, ordinal: Int, value:
Array[Byte]): Unit = {
- row.update(ordinal, SparkSqlSerializer.deserialize[Any](value))
+private[sql] case class DECIMAL(precision: Int, scale: Int)
+ extends ByteArrayColumnType[Decimal](20) {
--- End diff --
can we save the length header for decimal? i.e. always write 16 bytes.
---
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]