cgivre opened a new pull request #2348:
URL: https://github.com/apache/drill/pull/2348


   # [DRILL-8020](https://issues.apache.org/jira/browse/DRILL-8020): Add JSON 
Configuration Options to HTTP Rest Plugin
   
   ## Description
   This PR allows users to configure how Drill reads incoming JSON from 
individual API connections.  It has the effect of overriding the system-wide 
settings for JSON, within the context of a specific API connection. 
   
   ## Documentation
   Drill has a collection of JSON configuration options to allow you to 
configure how Drill interprets JSON files.  These are set at the global level, 
however the HTTP plugin 
   allows you to configure these options individually per connection and 
override the Drill defaults.  The options are:
   
   * `allowNanInf`:  Configures the connection to interpret `NaN` and `Inf` 
values
   * `allTextMode`:  By default, Drill attempts to infer data types from JSON 
data. If the data is malformed, Drill may throw schema change exceptions. If 
your data is 
     inconsistent, you can enable `allTextMode` which when true, Drill will 
read all JSON values as strings, rather than try to infer the data type. 
   * `readNumbersAsDouble`:  By default Drill will attempt to interpret 
integers, floating point number types and strings.  One challenge is when data 
is consistent, Drill may 
     throw schema change exceptions. In addition to `allTextMode`, you can make 
Drill less sensitive by setting the `readNumbersAsDouble` to `true` which 
causes Drill to read all 
     numeric fields in JSON data as `double` data type rather than trying to 
distinguish between ints and doubles.
   * `enableEscapeAnyChar`:  Allows a user to escape any character with a \
   
   All of these can be set by adding the `jsonOptions` to your connection 
configuration as shown below:
   
   ```json
   
   "jsonOptions": {
     "allTextMode": true, 
     "readNumbersAsDouble": true
   }
   
   ```
   
   ## Testing
   Added unit test


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to