Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/17604#discussion_r110853394
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala
---
@@ -204,20 +204,19 @@ object JavaTypeInference {
typeToken.getRawType match {
case c if !inferExternalType(c).isInstanceOf[ObjectType] => getPath
- case c if c == classOf[java.lang.Short] =>
- NewInstance(c, getPath :: Nil, ObjectType(c))
- case c if c == classOf[java.lang.Integer] =>
- NewInstance(c, getPath :: Nil, ObjectType(c))
- case c if c == classOf[java.lang.Long] =>
- NewInstance(c, getPath :: Nil, ObjectType(c))
- case c if c == classOf[java.lang.Double] =>
- NewInstance(c, getPath :: Nil, ObjectType(c))
- case c if c == classOf[java.lang.Byte] =>
- NewInstance(c, getPath :: Nil, ObjectType(c))
- case c if c == classOf[java.lang.Float] =>
- NewInstance(c, getPath :: Nil, ObjectType(c))
- case c if c == classOf[java.lang.Boolean] =>
- NewInstance(c, getPath :: Nil, ObjectType(c))
+ case c if c == classOf[java.lang.Short] ||
--- End diff --
Is this simpler as
```
case c: java.lang.Short | java.lang.Integer | java.lang.Long | ... =>
```
I believe it's the same thing but don't know if it is implemented in a
meaningfully different way. Seems like it ought to be no worse at runtime but I
don't know.
---
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]