Dmitry Lychagin has submitted this change and it was merged.

Change subject: [ASTERIXDB-2313][EXT] JSONDataParser support for non-object 
roots
......................................................................


[ASTERIXDB-2313][EXT] JSONDataParser support for non-object roots

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- JSONDataParser API should support parsing documents
  with non-objects at the root

Change-Id: I313924d0704f5ac735e592b46ed41e0e2f7cfd06
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2459
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
---
M 
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/JSONDataParser.java
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Till Westmann: Looks good to me, approved
  Jenkins: Verified; No violations found

Objections:
  Anon. E. Moose #1000171: Violations found



diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/JSONDataParser.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/JSONDataParser.java
index bbe4a60..ce8780d 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/JSONDataParser.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/JSONDataParser.java
@@ -119,6 +119,18 @@
         }
     }
 
+    public boolean parseAnyValue(DataOutput out) throws HyracksDataException {
+        try {
+            if (nextToken() == ADMToken.EOF) {
+                return false;
+            }
+            parseValue(BuiltinType.ANY, out);
+            return true;
+        } catch (IOException e) {
+            throw new 
RuntimeDataException(ErrorCode.RECORD_READER_MALFORMED_INPUT_STREAM, e);
+        }
+    }
+
     @Override
     public boolean reset(InputStream in) throws IOException {
         setInputStream(in);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2459
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I313924d0704f5ac735e592b46ed41e0e2f7cfd06
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Dmitry Lychagin <dmitry.lycha...@couchbase.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Dmitry Lychagin <dmitry.lycha...@couchbase.com>
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>

Reply via email to