asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Jacobs (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb-bad[master]: Match Changes to Asterix insert with return clause
Date Wed, 04 Jan 2017 06:01:29 GMT
Steven Jacobs has submitted this change and it was merged.

Change subject: Match Changes to Asterix insert with return clause
......................................................................


Match Changes to Asterix insert with return clause

Change-Id: I9fc3b5ebcaab5f00965e654f061967251a0febd8
---
M asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
M asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
M asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
M asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
4 files changed, 8 insertions(+), 9 deletions(-)

Approvals:
  Yingyi Bu: Looks good to me, approved
  Jenkins: Verified



diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
index 85ee0fc..af7394e 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
@@ -196,20 +196,18 @@
                 VariableExpr useResultVar = new VariableExpr(new VarIdentifier("$result",
0));
                 useResultVar.setIsNewVar(false);
                 useSubscriptionVar.setIsNewVar(false);
-                Query returnQuery = new Query(false);
                 List<Clause> clauseList = new ArrayList<>();
                 LetClause let = new LetClause(subscriptionVar,
                         new FieldAccessor(useResultVar, new Identifier(BADConstants.SubscriptionId)));
                 clauseList.add(let);
                 FLWOGRExpression body = new FLWOGRExpression(clauseList, useSubscriptionVar);
-                returnQuery.setBody(body);
 
                 metadataProvider.setResultSetId(new ResultSetId(resultSetIdCounter++));
                 metadataProvider.setResultAsyncMode(
                         resultDelivery == ResultDelivery.ASYNC || resultDelivery == ResultDelivery.DEFERRED);
                 InsertStatement insert = new InsertStatement(new Identifier(dataverse),
                         new Identifier(subscriptionsDatasetName), subscriptionTuple, varCounter,
resultVar,
-                        returnQuery);
+ body);
                 ((QueryTranslator) statementExecutor).handleInsertUpsertStatement(metadataProvider,
insert, hcc, hdc,
                         resultDelivery, stats, false);
             } else {
diff --git a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
index 889af1f..b642fed 100644
--- a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
+++ b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-create.plan
@@ -17,7 +17,7 @@
                         -- STREAM_PROJECT  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- INSERT_DELETE  |PARTITIONED|
-                              -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
+                              -- HASH_PARTITION_EXCHANGE [$$35]  |PARTITIONED|
                                 -- ASSIGN  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- ASSIGN  |PARTITIONED|
diff --git a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
index c5871f9..68d1c86 100644
--- a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
+++ b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-subscribe.plan
@@ -17,7 +17,7 @@
                         -- STREAM_PROJECT  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- INSERT_DELETE  |PARTITIONED|
-                              -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
+                              -- HASH_PARTITION_EXCHANGE [$$35]  |PARTITIONED|
                                 -- ASSIGN  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- ASSIGN  |PARTITIONED|
@@ -62,10 +62,11 @@
         -- STREAM_PROJECT  |PARTITIONED|
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
             -- INSERT_DELETE  |PARTITIONED|
-              -- HASH_PARTITION_EXCHANGE [$$5]  |PARTITIONED|
+              -- HASH_PARTITION_EXCHANGE [$$8]  |PARTITIONED|
                 -- ASSIGN  |UNPARTITIONED|
                   -- STREAM_PROJECT  |UNPARTITIONED|
                     -- ASSIGN  |UNPARTITIONED|
-                      -- ASSIGN  |UNPARTITIONED|
+                      -- STREAM_PROJECT  |UNPARTITIONED|
                         -- ASSIGN  |UNPARTITIONED|
-                          -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
+                          -- ASSIGN  |UNPARTITIONED|
+                            -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
index bdb8734..79aaa8c 100644
--- a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
+++ b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-unsubscribe.plan
@@ -17,7 +17,7 @@
                         -- STREAM_PROJECT  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                             -- INSERT_DELETE  |PARTITIONED|
-                              -- HASH_PARTITION_EXCHANGE [$$36]  |PARTITIONED|
+                              -- HASH_PARTITION_EXCHANGE [$$35]  |PARTITIONED|
                                 -- ASSIGN  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- ASSIGN  |PARTITIONED|

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9fc3b5ebcaab5f00965e654f061967251a0febd8
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sjaco002@ucr.edu>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Steven Jacobs <sjaco002@ucr.edu>
Gerrit-Reviewer: Yingyi Bu <buyingyi@gmail.com>

Mime
View raw message