You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/09/14 23:24:38 UTC

[GitHub] [druid] jon-wei opened a new pull request, #13089: Add JsonInputFormat option to assume newline delimited JSON, improve handling for non-NDJSON

jon-wei opened a new pull request, #13089:
URL: https://github.com/apache/druid/pull/13089

   When JsonInputFormat is used for streaming ingestion, if the input string contains multiple JSON events, but there is a parse exception occurs, all events in the record will be discarded, even if some events were valid (see https://github.com/apache/druid/pull/10383)
   
   This PR adds the following:
   - A `assumedNewlineDelimited` option for JsonInputFormat that can be used when the input is known to be newline-delimited JSON. This will force the input format to create a `JsonLineReader`, which can parse lines independently, so that a parse exception on one line will not prevent other valid lines from being ingested.
   - A `useJsonNodeReader` option for JsonInputFormat. If true, instead of creating a `JsonReader`, the input format will create a new `JsonNodeReader` for parsing multi-line JSON. This new parser splits an input string into `JsonNode` objects and parses them one by one into `InputRow`. This allows valid events found prior to a parse exception to be ingested. Potentially valid events after invalid JSON syntax is encountered will still be ignored. This also prevents valid JSON events with an unparseable timestamp from causing other events in the same input string to be discarded.
   
   This PR has:
   - [x] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [x] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [x] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [x] been tested in a test Druid cluster.
   


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jon-wei commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
jon-wei commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r978893807


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java:
##########
@@ -109,9 +144,13 @@ public boolean isSplittable()
   @Override
   public InputEntityReader createReader(InputRowSchema inputRowSchema, InputEntity source, File temporaryDirectory)
   {
-    return this.lineSplittable ?
-           new JsonLineReader(inputRowSchema, source, getFlattenSpec(), objectMapper, keepNullColumns) :
-           new JsonReader(inputRowSchema, source, getFlattenSpec(), objectMapper, keepNullColumns);
+    if (this.lineSplittable || this.assumeNewlineDelimited) {

Review Comment:
   `lineSplittable` is used as an indicator from the task implementation as to whether it expects the input to be newline delimited (and thus use either JsonLineReader or JsonReader). Prior to this patch, batch tasks would always use newline delimited (JsonLineReader) and streaming tasks would always use the multiline parser (JsonReader).
   
   With this patch, batch tasks would still always use newline delimited, while for streaming tasks the behavior is configurable (controlled by the new asssumeNewlineDelimited property)



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jon-wei commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
jon-wei commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r974504090


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonNodeReader.java:
##########
@@ -0,0 +1,182 @@
+/*
+ * 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.druid.data.input.impl;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MappingIterator;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.commons.io.IOUtils;
+import org.apache.druid.data.input.InputEntity;
+import org.apache.druid.data.input.InputRow;
+import org.apache.druid.data.input.InputRowSchema;
+import org.apache.druid.data.input.IntermediateRowParsingReader;
+import org.apache.druid.java.util.common.CloseableIterators;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.parsers.CloseableIterator;
+import org.apache.druid.java.util.common.parsers.JSONFlattenerMaker;
+import org.apache.druid.java.util.common.parsers.JSONPathSpec;
+import org.apache.druid.java.util.common.parsers.ObjectFlattener;
+import org.apache.druid.java.util.common.parsers.ObjectFlatteners;
+import org.apache.druid.java.util.common.parsers.ParseException;
+import org.apache.druid.utils.CollectionUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * In contrast to {@link JsonLineReader} which processes input text line by line independently,
+ * this class tries to split the input into a list of JsonNode objects, and then parses each JsonNode independently
+ * into an InputRow.
+ *
+ * <p>
+ * The input text can be:
+ * 1. a JSON string of an object in a line or multiple lines(such as pretty-printed JSON text)
+ * 2. multiple JSON object strings concated by white space character(s)
+ * <p>
+ * If an input string contains invalid JSON syntax, any valid JSON objects found prior to encountering the invalid

Review Comment:
   Timestamp in wrong format errors are special, in that Druid requires a valid __time field. For other columns, such parse errors would be detected at a later stage, and wouldn't run into the same issue of preventing other events from being ingested
   
   The JSON syntax errors here are errors where malformed JSON syntax prevents the event from being deserialized at all into a map.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] vogievetsky commented on pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
vogievetsky commented on PR #13089:
URL: https://github.com/apache/druid/pull/13089#issuecomment-1247606121

   Does this need to be documented and/or surfaced in the console?


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] zachjsh commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
zachjsh commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r977963559


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java:
##########
@@ -85,6 +106,8 @@ public JsonInputFormat(
       objectMapper.configure(feature, entry.getValue());
     }
     this.lineSplittable = lineSplittable;
+    this.assumeNewlineDelimited = assumeNewlineDelimited != null && assumeNewlineDelimited;
+    this.useJsonNodeReader = useJsonNodeReader != null && useJsonNodeReader;

Review Comment:
   The description for this property above seems to indicate that it should be used for non-newline delimited JSON. Would `assumeNewLineDelimted` true interfere with this / should this be forced to false if `assumeNewLineDelimted` is true



##########
core/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java:
##########
@@ -85,6 +106,8 @@ public JsonInputFormat(
       objectMapper.configure(feature, entry.getValue());
     }
     this.lineSplittable = lineSplittable;
+    this.assumeNewlineDelimited = assumeNewlineDelimited != null && assumeNewlineDelimited;
+    this.useJsonNodeReader = useJsonNodeReader != null && useJsonNodeReader;

Review Comment:
   The description for this property above seems to indicate that it should be used for non-newline delimited JSON. Would `assumeNewLineDelimted` true interfere with this / should this be forced to false if `assumeNewLineDelimted` is true?



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] YongGang commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
YongGang commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r973365130


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonNodeReader.java:
##########
@@ -0,0 +1,182 @@
+/*
+ * 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.druid.data.input.impl;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MappingIterator;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.commons.io.IOUtils;
+import org.apache.druid.data.input.InputEntity;
+import org.apache.druid.data.input.InputRow;
+import org.apache.druid.data.input.InputRowSchema;
+import org.apache.druid.data.input.IntermediateRowParsingReader;
+import org.apache.druid.java.util.common.CloseableIterators;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.parsers.CloseableIterator;
+import org.apache.druid.java.util.common.parsers.JSONFlattenerMaker;
+import org.apache.druid.java.util.common.parsers.JSONPathSpec;
+import org.apache.druid.java.util.common.parsers.ObjectFlattener;
+import org.apache.druid.java.util.common.parsers.ObjectFlatteners;
+import org.apache.druid.java.util.common.parsers.ParseException;
+import org.apache.druid.utils.CollectionUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * In contrast to {@link JsonLineReader} which processes input text line by line independently,
+ * this class tries to split the input into a list of JsonNode objects, and then parses each JsonNode independently
+ * into an InputRow.
+ *
+ * <p>
+ * The input text can be:
+ * 1. a JSON string of an object in a line or multiple lines(such as pretty-printed JSON text)
+ * 2. multiple JSON object strings concated by white space character(s)
+ * <p>
+ * If an input string contains invalid JSON syntax, any valid JSON objects found prior to encountering the invalid

Review Comment:
   Wonder whether we can distinguish whether the failure is due to JSON syntax error or data field in wrong format (e.g. wrong Timestamp format).
   If it's due to field in wrong format then we can continue to parse the rest.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
clintropolis commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r978581828


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java:
##########
@@ -85,6 +106,8 @@ public JsonInputFormat(
       objectMapper.configure(feature, entry.getValue());
     }
     this.lineSplittable = lineSplittable;
+    this.assumeNewlineDelimited = assumeNewlineDelimited != null && assumeNewlineDelimited;
+    this.useJsonNodeReader = useJsonNodeReader != null && useJsonNodeReader;

Review Comment:
   seems like maybe it would be an error to indicate `useJsonNodeReader` if `assumeNewLineDelimted` is set, though ignoring it seems ok too :shrug:



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on PR #13089:
URL: https://github.com/apache/druid/pull/13089#issuecomment-1247514339

   I think the new option `assumedNewlineDelimited` on JsonFormat is a good design. 
   I'm wondering if we can use this option to replace the internal `lineSplitter` property?


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jon-wei commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
jon-wei commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r978894319


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java:
##########
@@ -85,6 +106,8 @@ public JsonInputFormat(
       objectMapper.configure(feature, entry.getValue());
     }
     this.lineSplittable = lineSplittable;
+    this.assumeNewlineDelimited = assumeNewlineDelimited != null && assumeNewlineDelimited;
+    this.useJsonNodeReader = useJsonNodeReader != null && useJsonNodeReader;

Review Comment:
   okay, that makes sense, I'll have it be an error



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] zachjsh commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
zachjsh commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r977968984


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java:
##########
@@ -109,9 +144,13 @@ public boolean isSplittable()
   @Override
   public InputEntityReader createReader(InputRowSchema inputRowSchema, InputEntity source, File temporaryDirectory)
   {
-    return this.lineSplittable ?
-           new JsonLineReader(inputRowSchema, source, getFlattenSpec(), objectMapper, keepNullColumns) :
-           new JsonReader(inputRowSchema, source, getFlattenSpec(), objectMapper, keepNullColumns);
+    if (this.lineSplittable || this.assumeNewlineDelimited) {

Review Comment:
   When would `lineSplitable` be false, but the the data is actually newLineDelimited? Does this situation arise  when you have a batch of new line delimited json events being ingested at one time, for example?



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jon-wei merged pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
jon-wei merged PR #13089:
URL: https://github.com/apache/druid/pull/13089


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jon-wei commented on pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
jon-wei commented on PR #13089:
URL: https://github.com/apache/druid/pull/13089#issuecomment-1248753600

   @FrankChen021 Hm, I'm inclined to keep the internal `lineSplittable` property for now, since we don't support multi-line JSON for batch ingestion, I feel like we'd still need some kind of thing to force batch ingestion to use the `JsonLineReader` (like if the user were to specify `assumeNewlineDelimited` = false in a batch job)
   
   @vogievetsky I added some docs for the new properties


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] YongGang commented on a diff in pull request #13089: Add JsonInputFormat option to assume newline delimited JSON, improve parse exception handling for multiline JSON

Posted by GitBox <gi...@apache.org>.
YongGang commented on code in PR #13089:
URL: https://github.com/apache/druid/pull/13089#discussion_r973365130


##########
core/src/main/java/org/apache/druid/data/input/impl/JsonNodeReader.java:
##########
@@ -0,0 +1,182 @@
+/*
+ * 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.druid.data.input.impl;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MappingIterator;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.commons.io.IOUtils;
+import org.apache.druid.data.input.InputEntity;
+import org.apache.druid.data.input.InputRow;
+import org.apache.druid.data.input.InputRowSchema;
+import org.apache.druid.data.input.IntermediateRowParsingReader;
+import org.apache.druid.java.util.common.CloseableIterators;
+import org.apache.druid.java.util.common.StringUtils;
+import org.apache.druid.java.util.common.parsers.CloseableIterator;
+import org.apache.druid.java.util.common.parsers.JSONFlattenerMaker;
+import org.apache.druid.java.util.common.parsers.JSONPathSpec;
+import org.apache.druid.java.util.common.parsers.ObjectFlattener;
+import org.apache.druid.java.util.common.parsers.ObjectFlatteners;
+import org.apache.druid.java.util.common.parsers.ParseException;
+import org.apache.druid.utils.CollectionUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * In contrast to {@link JsonLineReader} which processes input text line by line independently,
+ * this class tries to split the input into a list of JsonNode objects, and then parses each JsonNode independently
+ * into an InputRow.
+ *
+ * <p>
+ * The input text can be:
+ * 1. a JSON string of an object in a line or multiple lines(such as pretty-printed JSON text)
+ * 2. multiple JSON object strings concated by white space character(s)
+ * <p>
+ * If an input string contains invalid JSON syntax, any valid JSON objects found prior to encountering the invalid

Review Comment:
   Wonder whether we can distinguish the failure is due to JSON syntax error or data field in wrong format (e.g. wrong Timestamp format).
   If it's due to field in wrong format then we can continue to parse the rest.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org