asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yingyi Bu (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: ASTERIXDB-1754: fix NPE in CopyLimitDownRule.
Date Tue, 20 Dec 2016 21:44:36 GMT
Yingyi Bu has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1399

Change subject: ASTERIXDB-1754: fix NPE in CopyLimitDownRule.
......................................................................

ASTERIXDB-1754: fix NPE in CopyLimitDownRule.

Change-Id: Ia9e26912a048c680aa9db7a12cd3933a7acbde37
---
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.ddl.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.2.query.sqlpp
A asterixdb/asterix-app/src/test/resources/runtimets/results/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.adm
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/CopyLimitDownRule.java
5 files changed, 73 insertions(+), 0 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/99/1399/1

diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.ddl.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.ddl.sqlpp
new file mode 100644
index 0000000..7eb1cd1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.ddl.sqlpp
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+drop  dataverse test if exists;
+create  dataverse test;
+
+use test;
+
+create type CustomerType as
+{
+  cid : bigint
+}
+
+create type OrderType as
+{
+  oid : bigint
+}
+
+create external dataset Customers(CustomerType) using localfs((`path`=`asterix_nc1://data/nontagged/customerData.json`),(`format`=`adm`));
+
+create external dataset Orders(OrderType) using localfs((`path`=`asterix_nc1://data/nontagged/orderData.json`),(`format`=`adm`));
+
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.2.query.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.2.query.sqlpp
new file mode 100644
index 0000000..74e50e3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.2.query.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+USE test;
+
+SELECT c.name AS cust_name,
+       c.age AS cust_age,
+       o.total AS order_total
+FROM Customers c, Orders o
+WHERE c.cid = o.cid AND c.age != o.total
+LIMIT 1
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.adm
b/asterixdb/asterix-app/src/test/resources/runtimets/results/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.adm
new file mode 100644
index 0000000..c18fb3d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/custord/query-ASTERIXDB-1754/query-ASTERIXDB-1754.1.adm
@@ -0,0 +1 @@
+{ "cust_name": "Jodi Alex", "cust_age": 19, "order_total": 7.206 }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 57be018..bd3266e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -1411,6 +1411,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="custord">
+      <compilation-unit name="query-ASTERIXDB-1754">
+        <output-dir compare="Text">query-ASTERIXDB-1754</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="custord">
       <compilation-unit name="load-test">
         <output-dir compare="Text">load-test</output-dir>
       </compilation-unit>
diff --git a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/CopyLimitDownRule.java
b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/CopyLimitDownRule.java
index a68ed6c..372af26 100644
--- a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/CopyLimitDownRule.java
+++ b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/CopyLimitDownRule.java
@@ -103,6 +103,7 @@
             limitCloneOp.setPhysicalOperator(new StreamLimitPOperator());
             limitCloneOp.getInputs().add(new MutableObject<ILogicalOperator>(unsafeOp));
             limitCloneOp.setExecutionMode(unsafeOp.getExecutionMode());
+            OperatorPropertiesUtil.computeSchemaRecIfNull((AbstractLogicalOperator) unsafeOp);
             limitCloneOp.recomputeSchema();
             unsafeOpRef.setValue(limitCloneOp);
             context.computeAndSetTypeEnvironmentForOperator(limitCloneOp);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9e26912a048c680aa9db7a12cd3933a7acbde37
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <buyingyi@gmail.com>

Mime
View raw message