Github user BryanCutler commented on a diff in the pull request:
https://github.com/apache/spark/pull/18754#discussion_r139762422
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/arrow/ArrowWriter.scala
---
@@ -224,6 +226,25 @@ private[arrow] class DoubleWriter(val valueVector:
NullableFloat8Vector) extends
}
}
+private[arrow] class DecimalWriter(
+ val valueVector: NullableDecimalVector,
+ precision: Int,
+ scale: Int) extends ArrowFieldWriter {
+
+ override def valueMutator: NullableDecimalVector#Mutator =
valueVector.getMutator()
+
+ override def setNull(): Unit = {
+ valueMutator.setNull(count)
+ }
+
+ override def setValue(input: SpecializedGetters, ordinal: Int): Unit = {
+ valueMutator.setIndexDefined(count)
+ val decimal = input.getDecimal(ordinal, precision, scale)
+ decimal.changePrecision(precision, scale)
+ DecimalUtility.writeBigDecimalToArrowBuf(decimal.toJavaBigDecimal,
valueVector.getBuffer, count)
--- End diff --
I haven't tried running those tests for 0.7 yet, let me see if I can
reproduce
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]