Github user maropu commented on a diff in the pull request: https://github.com/apache/spark/pull/15257#discussion_r81080352 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala --- @@ -46,12 +57,17 @@ object Literal { case s: String => Literal(UTF8String.fromString(s), StringType) case b: Boolean => Literal(b, BooleanType) case d: BigDecimal => Literal(Decimal(d), DecimalType(Math.max(d.precision, d.scale), d.scale)) - case d: java.math.BigDecimal => + case d: JavaBigDecimal => Literal(Decimal(d), DecimalType(Math.max(d.precision, d.scale), d.scale())) case d: Decimal => Literal(d, DecimalType(Math.max(d.precision, d.scale), d.scale)) case t: Timestamp => Literal(DateTimeUtils.fromJavaTimestamp(t), TimestampType) case d: Date => Literal(DateTimeUtils.fromJavaDate(d), DateType) case a: Array[Byte] => Literal(a, BinaryType) + case a: Array[_] => --- End diff -- Sorry for my bad explanation. For example, I added check codes below; ``` case a: Array[_] => println("Array[] class in runtime:" + a.getClass.getSimpleName()) ... ``` And, then run this code; ``` scala> Literal(scala.Array(1, 2, 3)) Array[] class in runtime:int[] ``` IIUC, `int[]` is a java native array type and there is no type signature here. Since `schemaFor` needs type signatures, I'm afraid we cannot this reflection func here. There are other workarounds though, I couldn't find them. Any better idea?
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org