HyukjinKwon commented on a change in pull request #23653: [SPARK-26711][SQL] 
Lazily convert string values to BigDecimal during JSON schema inference
URL: https://github.com/apache/spark/pull/23653#discussion_r251175102
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala
 ##########
 @@ -122,7 +122,7 @@ private[sql] class JsonInferSchema(options: JSONOptions) 
extends Serializable {
 
       case VALUE_STRING =>
         val field = parser.getText
-        val decimalTry = allCatch opt {
+        lazy val decimalTry = allCatch opt {
 
 Review comment:
   Yup. This is what I suggested. I manually tested it as well. LGTM.

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