Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/15044#discussion_r86524255
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/CatalystTypeConverters.scala
---
@@ -158,6 +158,20 @@ object CatalystTypeConverters {
override def toCatalystImpl(scalaValue: Any): ArrayData = {
scalaValue match {
+ case a: Array[Boolean] =>
+ UnsafeArrayData.fromPrimitiveArray(a)
+ case a: Array[Byte] =>
+ UnsafeArrayData.fromPrimitiveArray(a)
+ case a: Array[Short] =>
+ UnsafeArrayData.fromPrimitiveArray(a)
+ case a: Array[Int] =>
+ UnsafeArrayData.fromPrimitiveArray(a)
+ case a: Array[Long] =>
+ UnsafeArrayData.fromPrimitiveArray(a)
+ case a: Array[Float] =>
+ UnsafeArrayData.fromPrimitiveArray(a)
+ case a: Array[Double] =>
+ UnsafeArrayData.fromPrimitiveArray(a)
--- End diff --
My benchmark does not cover this branch.
[This
test](https://github.com/kiszk/spark/blob/b5473e3b6675c6bbfdd3fe261699f855faf39c94/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/CatalystTypeConvertersSuite.scala#L72-L73)
causes an failure without this branch. Should we drop this test and this
branch?
---
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]