You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by sj...@apache.org on 2018/06/27 22:21:53 UTC

asterixdb-bad git commit: pull channels are complete

Repository: asterixdb-bad
Updated Branches:
  refs/heads/resultsFinalVersion a2512f687 -> 849865b29


pull channels are complete


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

Branch: refs/heads/resultsFinalVersion
Commit: 849865b29575a60b3257119093ed8fa0344c1749
Parents: a2512f6
Author: Steven Glenn Jacobs <sj...@ucr.edu>
Authored: Wed Jun 27 15:20:54 2018 -0700
Committer: Steven Glenn Jacobs <sj...@ucr.edu>
Committed: Wed Jun 27 15:20:54 2018 -0700

----------------------------------------------------------------------
 .../bad/lang/statement/CreateChannelStatement.java   | 15 ++++++++++++---
 .../create_channel_check_metadata.1.adm              |  2 +-
 .../drop_channel_check_metadata.1.adm                |  4 ++--
 3 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/849865b2/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
index eecf937..0e30c01 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
@@ -267,10 +267,19 @@ public class CreateChannelStatement extends ExtensionStatement {
         builder.append("select result, ");
         builder.append(BADConstants.ChannelExecutionTime + ", ");
         builder.append("sub." + BADConstants.ChannelSubscriptionId + " as " + BADConstants.ChannelSubscriptionId + ",");
-        builder.append("current_datetime() as " + BADConstants.DeliveryTime + "\n");
-        builder.append("from " + dataverse + "." + channelSubscriptionsTableName + " sub,\n");
+        builder.append("current_datetime() as " + BADConstants.DeliveryTime + ",\n");
+
+        builder.append(
+                "(select b." + BADConstants.BrokerEndPoint + ", bs." + BADConstants.BrokerSubscriptionId + " from\n");
         builder.append(dataverse + "." + brokerSubscriptionsTableName + " bs,\n");
-        builder.append(BADConstants.BAD_DATAVERSE_NAME + "." + BADConstants.BROKER_KEYWORD + " b, \n");
+        builder.append(BADConstants.BAD_DATAVERSE_NAME + "." + BADConstants.BROKER_KEYWORD + " b\n");
+        builder.append("where bs." + BADConstants.BrokerName + " = b." + BADConstants.BrokerName + "\n");
+        builder.append("and bs." + BADConstants.DataverseName + " = b." + BADConstants.DataverseName + "\n");
+        builder.append(
+                "and bs." + BADConstants.ChannelSubscriptionId + " = sub." + BADConstants.ChannelSubscriptionId + "\n");
+        builder.append(") as brokerSubIds\n");
+
+        builder.append("from " + dataverse + "." + channelSubscriptionsTableName + " sub,\n");
         builder.append(function.getNamespace() + "." + function.getName() + "(");
         int i = 0;
         for (; i < function.getArity() - 1; i++) {

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/849865b2/asterix-bad/src/test/resources/runtimets/results/channel/create_channel_check_metadata/create_channel_check_metadata.1.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/channel/create_channel_check_metadata/create_channel_check_metadata.1.adm b/asterix-bad/src/test/resources/runtimets/results/channel/create_channel_check_metadata/create_channel_check_metadata.1.adm
index ff95244..f2169ac 100644
--- a/asterix-bad/src/test/resources/runtimets/results/channel/create_channel_check_metadata/create_channel_check_metadata.1.adm
+++ b/asterix-bad/src/test/resources/runtimets/results/channel/create_channel_check_metadata/create_channel_check_metadata.1.adm
@@ -1 +1 @@
-{ "DataverseName": "channels", "ChannelName": "nearbyTweetChannel", "ChannelSubscriptionsDatasetName": "nearbyTweetChannelChannelSubscriptions", "ResultsDatasetName": "nearbyTweetChannelResults", "Function": [ "channels", "NearbyTweetsContainingText", "2" ], "Duration": "PT10M", "Dependencies": [ [ [ "channels", "nearbyTweetChannelResults" ], [ "channels", "nearbyTweetChannelChannelSubscriptions" ], [ "channels", "nearbyTweetChannelBrokerSubscriptions" ] ], [ [ "channels", "NearbyTweetsContainingText", "2" ] ] ], "Body": "SET inline_with \"false\";\ninsert into channels.nearbyTweetChannelResults as a (\nwith channelExecutionTime as current_datetime() \nselect result, channelExecutionTime, sub.channelSubId as channelSubId,current_datetime() as deliveryTime\nfrom channels.nearbyTweetChannelChannelSubscriptions sub,\nchannels.nearbyTweetChannelBrokerSubscriptions bs,\nMetadata.Broker b, \nchannels.NearbyTweetsContainingText(sub.param0,sub.param1) result \n) returning a;", "BrokerSubscr
 iptionsDatasetName": "nearbyTweetChannelBrokerSubscriptions" }
\ No newline at end of file
+{ "DataverseName": "channels", "ChannelName": "nearbyTweetChannel", "ChannelSubscriptionsDatasetName": "nearbyTweetChannelChannelSubscriptions", "ResultsDatasetName": "nearbyTweetChannelResults", "Function": [ "channels", "NearbyTweetsContainingText", "2" ], "Duration": "PT10M", "Dependencies": [ [ [ "channels", "nearbyTweetChannelResults" ], [ "channels", "nearbyTweetChannelChannelSubscriptions" ], [ "channels", "nearbyTweetChannelBrokerSubscriptions" ] ], [ [ "channels", "NearbyTweetsContainingText", "2" ] ] ], "Body": "SET inline_with \"false\";\ninsert into channels.nearbyTweetChannelResults as a (\nwith channelExecutionTime as current_datetime() \nselect result, channelExecutionTime, sub.channelSubId as channelSubId,current_datetime() as deliveryTime,\n(select b.BrokerEndPoint, bs.brokerSubId from\nchannels.nearbyTweetChannelBrokerSubscriptions bs,\nMetadata.Broker b\nwhere bs.BrokerName = b.BrokerName\nand bs.DataverseName = b.DataverseName\nand bs.channelSubId = sub.channelSu
 bId\n) as brokerSubIds\nfrom channels.nearbyTweetChannelChannelSubscriptions sub,\nchannels.NearbyTweetsContainingText(sub.param0,sub.param1) result \n) returning a;", "BrokerSubscriptionsDatasetName": "nearbyTweetChannelBrokerSubscriptions" }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/849865b2/asterix-bad/src/test/resources/runtimets/results/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.adm
----------------------------------------------------------------------
diff --git a/asterix-bad/src/test/resources/runtimets/results/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.adm b/asterix-bad/src/test/resources/runtimets/results/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.adm
index 839d691..364cfab 100644
--- a/asterix-bad/src/test/resources/runtimets/results/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.adm
+++ b/asterix-bad/src/test/resources/runtimets/results/channel/drop_channel_check_metadata/drop_channel_check_metadata.1.adm
@@ -1,2 +1,2 @@
-{ "DataverseName": "channels", "ChannelName": "nearbyTweetChannel1", "ChannelSubscriptionsDatasetName": "nearbyTweetChannel1ChannelSubscriptions", "ResultsDatasetName": "nearbyTweetChannel1Results", "Function": [ "channels", "NearbyTweetsContainingText", "2" ], "Duration": "PT10M", "Dependencies": [ [ [ "channels", "nearbyTweetChannel1Results" ], [ "channels", "nearbyTweetChannel1ChannelSubscriptions" ], [ "channels", "nearbyTweetChannel1BrokerSubscriptions" ] ], [ [ "channels", "NearbyTweetsContainingText", "2" ] ] ], "Body": "SET inline_with \"false\";\ninsert into channels.nearbyTweetChannel1Results as a (\nwith channelExecutionTime as current_datetime() \nselect result, channelExecutionTime, sub.channelSubId as channelSubId,current_datetime() as deliveryTime\nfrom channels.nearbyTweetChannel1ChannelSubscriptions sub,\nchannels.nearbyTweetChannel1BrokerSubscriptions bs,\nMetadata.Broker b, \nchannels.NearbyTweetsContainingText(sub.param0,sub.param1) result \n) returning a;", "Bro
 kerSubscriptionsDatasetName": "nearbyTweetChannel1BrokerSubscriptions" }
-{ "DataverseName": "channels", "ChannelName": "nearbyTweetChannel3", "ChannelSubscriptionsDatasetName": "nearbyTweetChannel3ChannelSubscriptions", "ResultsDatasetName": "nearbyTweetChannel3Results", "Function": [ "channels", "NearbyTweetsContainingText", "2" ], "Duration": "PT10M", "Dependencies": [ [ [ "channels", "nearbyTweetChannel3Results" ], [ "channels", "nearbyTweetChannel3ChannelSubscriptions" ], [ "channels", "nearbyTweetChannel3BrokerSubscriptions" ] ], [ [ "channels", "NearbyTweetsContainingText", "2" ] ] ], "Body": "SET inline_with \"false\";\ninsert into channels.nearbyTweetChannel3Results as a (\nwith channelExecutionTime as current_datetime() \nselect result, channelExecutionTime, sub.channelSubId as channelSubId,current_datetime() as deliveryTime\nfrom channels.nearbyTweetChannel3ChannelSubscriptions sub,\nchannels.nearbyTweetChannel3BrokerSubscriptions bs,\nMetadata.Broker b, \nchannels.NearbyTweetsContainingText(sub.param0,sub.param1) result \n) returning a;", "Bro
 kerSubscriptionsDatasetName": "nearbyTweetChannel3BrokerSubscriptions" }
\ No newline at end of file
+{ "DataverseName": "channels", "ChannelName": "nearbyTweetChannel1", "ChannelSubscriptionsDatasetName": "nearbyTweetChannel1ChannelSubscriptions", "ResultsDatasetName": "nearbyTweetChannel1Results", "Function": [ "channels", "NearbyTweetsContainingText", "2" ], "Duration": "PT10M", "Dependencies": [ [ [ "channels", "nearbyTweetChannel1Results" ], [ "channels", "nearbyTweetChannel1ChannelSubscriptions" ], [ "channels", "nearbyTweetChannel1BrokerSubscriptions" ] ], [ [ "channels", "NearbyTweetsContainingText", "2" ] ] ], "Body": "SET inline_with \"false\";\ninsert into channels.nearbyTweetChannel1Results as a (\nwith channelExecutionTime as current_datetime() \nselect result, channelExecutionTime, sub.channelSubId as channelSubId,current_datetime() as deliveryTime,\n(select b.BrokerEndPoint, bs.brokerSubId from\nchannels.nearbyTweetChannel1BrokerSubscriptions bs,\nMetadata.Broker b\nwhere bs.BrokerName = b.BrokerName\nand bs.DataverseName = b.DataverseName\nand bs.channelSubId = sub.c
 hannelSubId\n) as brokerSubIds\nfrom channels.nearbyTweetChannel1ChannelSubscriptions sub,\nchannels.NearbyTweetsContainingText(sub.param0,sub.param1) result \n) returning a;", "BrokerSubscriptionsDatasetName": "nearbyTweetChannel1BrokerSubscriptions" }
+{ "DataverseName": "channels", "ChannelName": "nearbyTweetChannel3", "ChannelSubscriptionsDatasetName": "nearbyTweetChannel3ChannelSubscriptions", "ResultsDatasetName": "nearbyTweetChannel3Results", "Function": [ "channels", "NearbyTweetsContainingText", "2" ], "Duration": "PT10M", "Dependencies": [ [ [ "channels", "nearbyTweetChannel3Results" ], [ "channels", "nearbyTweetChannel3ChannelSubscriptions" ], [ "channels", "nearbyTweetChannel3BrokerSubscriptions" ] ], [ [ "channels", "NearbyTweetsContainingText", "2" ] ] ], "Body": "SET inline_with \"false\";\ninsert into channels.nearbyTweetChannel3Results as a (\nwith channelExecutionTime as current_datetime() \nselect result, channelExecutionTime, sub.channelSubId as channelSubId,current_datetime() as deliveryTime,\n(select b.BrokerEndPoint, bs.brokerSubId from\nchannels.nearbyTweetChannel3BrokerSubscriptions bs,\nMetadata.Broker b\nwhere bs.BrokerName = b.BrokerName\nand bs.DataverseName = b.DataverseName\nand bs.channelSubId = sub.c
 hannelSubId\n) as brokerSubIds\nfrom channels.nearbyTweetChannel3ChannelSubscriptions sub,\nchannels.NearbyTweetsContainingText(sub.param0,sub.param1) result \n) returning a;", "BrokerSubscriptionsDatasetName": "nearbyTweetChannel3BrokerSubscriptions" }
\ No newline at end of file