MaxGekk opened a new pull request #26797: [SPARK-30166][SQL] Eliminate 
compilation warnings in JSONOptions
URL: https://github.com/apache/spark/pull/26797
 
 
   ### What changes were proposed in this pull request?
   In the PR, I propose to replace `setJacksonOptions()` in `JSONOptions` by 
`buildJsonFactory()` which builds `JsonFactory` using `JsonFactoryBuilder`. 
This allows to avoid using **deprecated** feature configurations from 
`JsonParser.Feature`.
   
   ### Why are the changes needed?
   - The changes eliminate the following compilation warnings in 
`sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JSONOptions.scala`:
   ```
       Warning:Warning:line (137)Java enum ALLOW_NUMERIC_LEADING_ZEROS in Java 
enum Feature is deprecated: see corresponding Javadoc for more information.
       factory.configure(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS, 
allowNumericLeadingZeros)
       Warning:Warning:line (138)Java enum ALLOW_NON_NUMERIC_NUMBERS in Java 
enum Feature is deprecated: see corresponding Javadoc for more information.
       factory.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, 
allowNonNumericNumbers)
       Warning:Warning:line (139)Java enum 
ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER in Java enum Feature is deprecated: see 
corresponding Javadoc for more information.
       
factory.configure(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER,
       Warning:Warning:line (141)Java enum ALLOW_UNQUOTED_CONTROL_CHARS in Java 
enum Feature is deprecated: see corresponding Javadoc for more information.
       factory.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, 
allowUnquotedControlChars)
   ```
   - This put together building JsonFactory and set options from JSONOptions. 
So, we will not forget to call `setJacksonOptions` in the future.
   
   ### Does this PR introduce any user-facing change?
   No
   
   ### How was this patch tested?
   By `JsonSuite`, `JsonFunctionsSuite`, `JsonExpressionsSuite`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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