[
https://issues.apache.org/jira/browse/DRILL-8020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17435427#comment-17435427
]
ASF GitHub Bot commented on DRILL-8020:
---------------------------------------
cgivre commented on a change in pull request #2348:
URL: https://github.com/apache/drill/pull/2348#discussion_r738416108
##########
File path:
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpJsonOptions.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.drill.exec.store.http;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.Builder;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.drill.exec.ExecConstants;
+import org.apache.drill.exec.server.options.OptionSet;
+import org.apache.drill.exec.store.easy.json.loader.JsonLoaderOptions;
+
+@Slf4j
+@Builder
+@Getter
+@Accessors(fluent = true)
+@EqualsAndHashCode
+@ToString
+@JsonInclude(JsonInclude.Include.NON_DEFAULT)
+@JsonDeserialize(builder = HttpJsonOptions.HttpJsonOptionsBuilder.class)
+public class HttpJsonOptions {
+
+ @JsonInclude
+ private final boolean allowNanInf;
+
+ @JsonInclude
+ private final boolean allTextMode;
+
+ @JsonInclude
+ private final boolean readNumbersAsDouble;
+
+ @JsonInclude
+ private final boolean enableEscapeAnyChar;
+
+ /**
+ * Describes whether or not this reader can unwrap a single root array record
+ * and treat it like a set of distinct records.
+ */
+ @JsonInclude
+ private final boolean skipOuterList; // Default should be true
Review comment:
I removed that from the options that are user configurable. The main
ones I wanted to add are the `allTextMode` and `readNumbersAsDoubles`
--
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]
> Add JSON Configuration Options to HTTP Rest Plugin
> --------------------------------------------------
>
> Key: DRILL-8020
> URL: https://issues.apache.org/jira/browse/DRILL-8020
> Project: Apache Drill
> Issue Type: Improvement
> Components: Storage - Other
> Affects Versions: 1.19.0
> Reporter: Charles Givre
> Assignee: Charles Givre
> Priority: Major
> Fix For: 1.20.0
>
>
> 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
> }
> ```
--
This message was sent by Atlassian Jira
(v8.3.4#803005)