asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dl...@apache.org
Subject asterixdb git commit: [ASTERIXDB-2313][EXT] JSONDataParser support for non-object roots
Date Wed, 07 Mar 2018 00:35:43 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master bb29bc7c2 -> 5630d8a15


[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 <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/5630d8a1
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/5630d8a1
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/5630d8a1

Branch: refs/heads/master
Commit: 5630d8a15eba5332c3cbe472a4cbdbaab82b8bc4
Parents: bb29bc7
Author: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
Authored: Tue Mar 6 14:27:24 2018 -0800
Committer: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
Committed: Tue Mar 6 16:35:23 2018 -0800

----------------------------------------------------------------------
 .../apache/asterix/external/parser/JSONDataParser.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/5630d8a1/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/JSONDataParser.java
----------------------------------------------------------------------
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 class JSONDataParser extends AbstractNestedDataParser<ADMToken>
         }
     }
 
+    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);


Mime
View raw message