asterixdb git commit: Fix NULL/MISSING field value handing in Java UDF

2017-04-26 Thread xikui
Repository: asterixdb
Updated Branches:
  refs/heads/master b58572a9c -> c9571fc08


Fix NULL/MISSING field value handing in Java UDF

Add NULL/MISSING value support in Java UDF. This fixed the NPE when there
is a NULL/MISSING field in a record.

Change-Id: Icf110b2f5b3658847967f5ee7163fb2e47713813
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1695
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
BAD: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Yingyi Bu 


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

Branch: refs/heads/master
Commit: c9571fc089821a7967635ff999d4b38ec38ad48e
Parents: b58572a
Author: Xikui Wang 
Authored: Tue Apr 25 13:31:16 2017 -0700
Committer: Xikui Wang 
Committed: Wed Apr 26 11:15:41 2017 -0700

--
 .../external/library/JTypeObjectFactory.java|  8 +
 .../external/library/java/JObjectAccessors.java | 26 +++
 .../asterix/external/library/java/JObjects.java | 33 +++-
 3 files changed, 66 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c9571fc0/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/JTypeObjectFactory.java
--
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/JTypeObjectFactory.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/JTypeObjectFactory.java
index e2ed092..fb9fd79 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/JTypeObjectFactory.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/JTypeObjectFactory.java
@@ -19,6 +19,7 @@
 package org.apache.asterix.external.library;
 
 import org.apache.asterix.external.api.IJObject;
+import org.apache.asterix.external.library.java.JObjects;
 import org.apache.asterix.external.library.java.JObjects.JBoolean;
 import org.apache.asterix.external.library.java.JObjects.JCircle;
 import org.apache.asterix.external.library.java.JObjects.JDate;
@@ -46,6 +47,7 @@ import org.apache.asterix.om.types.AUnorderedListType;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.om.util.container.IObjectFactory;
 
+
 public class JTypeObjectFactory implements IObjectFactory {
 
 public static final JTypeObjectFactory INSTANCE = new JTypeObjectFactory();
@@ -108,6 +110,12 @@ public class JTypeObjectFactory implements 
IObjectFactory {
 case INT64:
 retValue = new JLong(0);
 break;
+case NULL:
+retValue = JObjects.JNull.INSTANCE;
+break;
+case MISSING:
+retValue = JObjects.JMissing.INSTANCE;
+break;
 case ORDEREDLIST:
 AOrderedListType ot = (AOrderedListType) type;
 IAType orderedItemType = ot.getItemType();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c9571fc0/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
--
diff --git 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
index f8755b4..a35bc69 100644
--- 
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
+++ 
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
@@ -140,6 +140,12 @@ public class JObjectAccessors {
 case DURATION:
 accessor = new JDurationAccessor();
 break;
+case NULL:
+accessor = new JNullAccessor();
+break;
+case MISSING:
+accessor = new JMissingAccessor();
+break;
 default:
 break;
 }
@@ -189,6 +195,26 @@ public class JObjectAccessors {
 }
 }
 
+public static class JNullAccessor implements IJObjectAccessor {
+
+@Override
+public IJObject access(IVisitablePointable pointable, 
IObjectPool objPool)
+

asterixdb git commit: Document the Query Service API

2017-04-26 Thread tillw
Repository: asterixdb
Updated Branches:
  refs/heads/master c9571fc08 -> 6c6479d0e


Document the Query Service API

Change-Id: Ifcefb1671ea305a5958c9a74a588b4aaa17f399f
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1698
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
BAD: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 
Reviewed-by: Michael Carey 


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

Branch: refs/heads/master
Commit: 6c6479d0e3f3f774703c8e9afa28259d9bd78bf7
Parents: c9571fc
Author: Till Westmann 
Authored: Tue Apr 25 23:17:04 2017 -0700
Committer: Michael Carey 
Committed: Wed Apr 26 15:40:08 2017 -0700

--
 asterixdb/asterix-doc/src/site/markdown/api.md | 475 +++-
 1 file changed, 173 insertions(+), 302 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/6c6479d0/asterixdb/asterix-doc/src/site/markdown/api.md
--
diff --git a/asterixdb/asterix-doc/src/site/markdown/api.md 
b/asterixdb/asterix-doc/src/site/markdown/api.md
index 2e2f08c..848f2c3 100644
--- a/asterixdb/asterix-doc/src/site/markdown/api.md
+++ b/asterixdb/asterix-doc/src/site/markdown/api.md
@@ -21,324 +21,195 @@
 
 ## Table of Contents
 
-* [DDL API](#DdlApi)
-* [Update API](#UpdateApi)
-* [Query API](#QueryApi)
-* [Mixed API](#AnyApi)
-* [Asynchronous Result API](#AsynchronousResultApi)
-* [Query Status API](#QueryStatusApi)
-* [Error Codes](#ErrorCodes)
-
-
-## DDL API [Back to 
TOC] ##
-
-*End point for the data definition statements*
-
-Endpoint: _/ddl_
-
-Parameters:
-
-
-
-  Parameter
-  Description
-  Required?
-
-
-  ddl
-  String containing DDL statements to modify Metadata
-  Yes
-
-
-
-This call does not return any result. If the operations were successful, HTTP 
OK status code is returned.
-
-### Example ###
-
- DDL Statements 
-
-
-drop dataverse company if exists;
-create dataverse company;
-use dataverse company;
-
-create type Emp as open {
-  id : int32,
-  name : string
-};
-
-create dataset Employee(Emp) primary key id;
-
-
-API call for the above DDL statements in the URL-encoded form.
-
-[http://localhost:19002/ddl?ddl=drop%20dataverse%20company%20if%20exists;create%20dataverse%20company;use%20dataverse%20company;create%20type%20Emp%20as%20open%20{id%20:%20int32,name%20:%20string};create%20dataset%20Employee(Emp)%20primary%20key%20id;](http://localhost:19002/ddl?ddl=drop%20dataverse%20company%20if%20exists;create%20dataverse%20company;use%20dataverse%20company;create%20type%20Emp%20as%20open%20{id%20:%20int32,name%20:%20string};create%20dataset%20Employee(Emp)%20primary%20key%20id;)
-
- Response 
-*HTTP OK 200*  
-``
-
-## Update API [Back to 
TOC] ##
-
-*End point for update statements (INSERT, DELETE and LOAD)*
-
-Endpoint: _/update_
-
-Parameters:
-
-
-
-  Parameter
-  Description
-  Required?
-
-
-  statements
-  String containing update (insert/delete) statements to execute
-  Yes
-
-
-
-This call does not return any result. If the operations were successful, HTTP 
OK status code is returned.
-
-### Example ###
-
- Update Statements 
-
-
-use dataverse company;
-
-insert into dataset Employee({ "id":123,"name":"John Doe"});
-
-
-API call for the above update statement in the URL-encoded form.
-
-[http://localhost:19002/update?statements=use%20dataverse%20company;insert%20into%20dataset%20Employee({%20%22id%22:123,%22name%22:%22John%20Doe%22});](http://localhost:19002/update?statements=use%20dataverse%20company;insert%20into%20dataset%20Employee({%20%22id%22:123,%22name%22:%22John%20Doe%22});)
-
- Response 
-*HTTP OK 200*  
-``
-
-## Query API [Back to 
TOC] ##
-
-*End point for query statements*
-
-Endpoint: _/query_
-
-Parameters:
-
-
-
-  Parameter
-  Description
-  Required?
-
-
-  query
-  Query string to pass to ASTERIX for execution
-  Yes
-
-
-  mode
-  Indicate if call should be synchronous or asynchronous. mode = 
synchronous blocks the call until results are available; mode = asynchronous 
returns immediately with a handle that can be used later to check the query’s 
status and to fetch results when available
-  No. default mode = synchronous
-
-
-
-Result: The result is returned as a JSON object as follows
-
-
-{
-   results: 
-   error-code: [, ]