MaxGekk commented on a change in pull request #23201: [SPARK-26246][SQL] 
Inferring TimestampType from JSON
URL: https://github.com/apache/spark/pull/23201#discussion_r250940285
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala
 ##########
 @@ -115,13 +121,19 @@ private[sql] class JsonInferSchema(options: JSONOptions) 
extends Serializable {
         // record fields' types have been combined.
         NullType
 
-      case VALUE_STRING if options.prefersDecimal =>
+      case VALUE_STRING =>
+        val field = parser.getText
         val decimalTry = allCatch opt {
 
 Review comment:
   We shouldn't. The `opt` method calls body by name: `def opt[U >: T](body: => 
U): Option[U]` It should try infer if `options.prefersDecimal` is false.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to