Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/18704#discussion_r135043913
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala
---
@@ -278,6 +555,46 @@ private[columnar] case object DictionaryEncoding
extends CompressionScheme {
}
override def hasNext: Boolean = buffer.hasRemaining
+
+ override def decompress(columnVector: ColumnVector, capacity: Int):
Unit = {
+ val nullsBuffer = buffer.duplicate().order(ByteOrder.nativeOrder())
+ nullsBuffer.rewind()
+ val nullCount = ByteBufferHelper.getInt(nullsBuffer)
+ var nextNullIndex = if (nullCount > 0)
ByteBufferHelper.getInt(nullsBuffer) else -1
+ var pos = 0
+ var seenNulls = 0
+ columnType.dataType match {
+ case _: IntegerType =>
+ while (pos < capacity) {
+ if (pos != nextNullIndex) {
+ val value = dictionary(buffer.getShort()).asInstanceOf[Int]
+ columnVector.putInt(pos, value)
--- End diff --
can we delay the decompression and set the dictionary to `ColumnVector`?
---
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]