Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13680#discussion_r73951262
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/UnsafeArraySuite.scala
 ---
    @@ -18,27 +18,131 @@
     package org.apache.spark.sql.catalyst.util
     
     import org.apache.spark.SparkFunSuite
    +import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
     import org.apache.spark.sql.catalyst.expressions.UnsafeArrayData
    +import org.apache.spark.unsafe.Platform
     
     class UnsafeArraySuite extends SparkFunSuite {
     
    -  test("from primitive int array") {
    -    val array = Array(1, 10, 100)
    -    val unsafe = UnsafeArrayData.fromPrimitiveArray(array)
    -    assert(unsafe.numElements == 3)
    -    assert(unsafe.getSizeInBytes == 4 + 4 * 3 + 4 * 3)
    -    assert(unsafe.getInt(0) == 1)
    -    assert(unsafe.getInt(1) == 10)
    -    assert(unsafe.getInt(2) == 100)
    +  val booleanArray = Array(false, true)
    +  val shortArray = Array(1.toShort, 10.toShort, 100.toShort)
    +  val intArray = Array(1, 10, 100)
    +  val longArray = Array(1.toLong, 10.toLong, 100.toLong)
    +  val floatArray = Array(1.1.toFloat, 2.2.toFloat, 3.3.toFloat)
    +  val doubleArray = Array(1.1, 2.2, 3.3)
    +  val stringArray = Array("1", "10", "100")
    --- End diff --
    
    When we infer the schema from given BigDecimal class, we use SYSTEM_DEFAUT, 
because we don't know the actual precision and scale. Could you specify the 
schema in the test?


---
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]

Reply via email to