Steven Jacobs has uploaded a new change for review.

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

Change subject: [ASTERIXDB-1972] Coordinated Change
......................................................................

[ASTERIXDB-1972] Coordinated Change

Change-Id: I191af547f3142fe5446ead4a2d053ea71e3f1d97
---
A 
asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced-index-only.sqlpp
M 
asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced.sqlpp
A 
asterix-bad/src/test/resources/optimizerts/results/channel/channel-advanced-index-only.plan
3 files changed, 201 insertions(+), 0 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb-bad 
refs/changes/76/2376/1

diff --git 
a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced-index-only.sqlpp
 
b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced-index-only.sqlpp
new file mode 100644
index 0000000..dd73769
--- /dev/null
+++ 
b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced-index-only.sqlpp
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+/*
+ * Description  : Check an advanced channel for index usage
+ * Expected Res : Success
+ * Date         : Oct 2017
+ */
+
+drop dataverse channels6 if exists;
+create dataverse channels6;
+use channels6;
+
+create type UserLocation as closed {
+  recordId: uuid,
+  location: circle,
+  userName: string,
+  timeStamp: datetime
+};
+
+create type EmergencyReport as closed {
+  reportId: uuid,
+  Etype: string,
+  location: circle,
+  timeStamp: datetime
+};
+
+create type EmergencyShelter as closed {
+  shelterName: string,
+  location: circle
+};
+
+create dataset UserLocations(UserLocation)
+primary key recordId autogenerated;
+
+create dataset EmergencyReports(EmergencyReport)
+primary key reportId autogenerated;
+
+create index locTimes on UserLocations(timeStamp);
+create index repTimes on EmergencyReports(timeStamp);
+
+create function RecentEmergenciesNearUser(userName) {
+  (
+  SELECT r AS report
+  FROM
+  (select value r from EmergencyReports r where r.timeStamp > 
current_datetime() - day_time_duration("PT10S")) r,
+  (select value r from UserLocations l where l.timeStamp > current_datetime() 
- day_time_duration("PT10S")) l
+  where l.userName = userName
+  and spatial_intersect(r.location,l.location)
+  )
+};
+
+write output to nc1:"rttest/channel-advanced.sqlpp";
+
+create repetitive channel EmergencyChannel using RecentEmergenciesNearUser@1 
period duration("PT10S");
\ No newline at end of file
diff --git 
a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced.sqlpp
 
b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced.sqlpp
index 53399e1..8ebe8c6 100644
--- 
a/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced.sqlpp
+++ 
b/asterix-bad/src/test/resources/optimizerts/queries/channel/channel-advanced.sqlpp
@@ -66,5 +66,6 @@
 };
 
 write output to nc1:"rttest/channel-advanced.sqlpp";
+set noindexonly 'true';
 
 create repetitive channel EmergencyChannel using RecentEmergenciesNearUser@1 
period duration("PT10S");
\ No newline at end of file
diff --git 
a/asterix-bad/src/test/resources/optimizerts/results/channel/channel-advanced-index-only.plan
 
b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-advanced-index-only.plan
new file mode 100644
index 0000000..dd68a36
--- /dev/null
+++ 
b/asterix-bad/src/test/resources/optimizerts/results/channel/channel-advanced-index-only.plan
@@ -0,0 +1,130 @@
+-- NOTIFY_BROKERS  |PARTITIONED|
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    -- PRE_CLUSTERED_GROUP_BY[$$133, $$channelExecutionTime]  |PARTITIONED|
+            {
+              -- AGGREGATE  |LOCAL|
+                -- NESTED_TUPLE_SOURCE  |LOCAL|
+            }
+      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+        -- STABLE_SORT [$$133(ASC), $$channelExecutionTime(ASC)]  |PARTITIONED|
+          -- HASH_PARTITION_EXCHANGE [$$133, $$channelExecutionTime]  
|PARTITIONED|
+            -- PRE_SORTED_DISTINCT_BY  |PARTITIONED|
+              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                -- STABLE_SORT [$$108(ASC)]  |PARTITIONED|
+                  -- HASH_PARTITION_EXCHANGE [$$108]  |PARTITIONED|
+                    -- STREAM_PROJECT  |PARTITIONED|
+                      -- COMMIT  |PARTITIONED|
+                        -- STREAM_PROJECT  |PARTITIONED|
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            -- INDEX_INSERT_DELETE  |PARTITIONED|
+                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                -- STREAM_PROJECT  |PARTITIONED|
+                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                    -- INSERT_DELETE  |PARTITIONED|
+                                      -- HASH_PARTITION_EXCHANGE [$$104]  
|PARTITIONED|
+                                        -- ASSIGN  |PARTITIONED|
+                                          -- STREAM_PROJECT  |PARTITIONED|
+                                            -- ASSIGN  |PARTITIONED|
+                                              -- STREAM_PROJECT  |PARTITIONED|
+                                                -- ASSIGN  |PARTITIONED|
+                                                  -- STREAM_PROJECT  
|PARTITIONED|
+                                                    -- ASSIGN  |PARTITIONED|
+                                                      -- STREAM_PROJECT  
|PARTITIONED|
+                                                        -- STREAM_SELECT  
|PARTITIONED|
+                                                          -- STREAM_PROJECT  
|PARTITIONED|
+                                                            -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                              -- 
HYBRID_HASH_JOIN [$$118][$$117]  |PARTITIONED|
+                                                                -- 
HASH_PARTITION_EXCHANGE [$$118]  |PARTITIONED|
+                                                                  -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                    -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                      -- 
HYBRID_HASH_JOIN [$$116, $$114][$$109, $$110]  |PARTITIONED|
+                                                                        -- 
HASH_PARTITION_EXCHANGE [$$116, $$114]  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
   -- BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                               
     -- ASSIGN  |UNPARTITIONED|
+                                                                               
       -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
+                                                                        -- 
HASH_PARTITION_EXCHANGE [$$109, $$110]  |PARTITIONED|
+                                                                          -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- DATASOURCE_SCAN  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                -- 
HASH_PARTITION_EXCHANGE [$$117]  |PARTITIONED|
+                                                                  -- 
STREAM_PROJECT  |PARTITIONED|
+                                                                    -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                      -- 
HYBRID_HASH_JOIN [$$111][$$127]  |PARTITIONED|
+                                                                        -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                          -- 
STREAM_SELECT  |PARTITIONED|
+                                                                            -- 
ASSIGN  |PARTITIONED|
+                                                                              
-- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
 -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
     -- STABLE_SORT [$$137(ASC)]  |PARTITIONED|
+                                                                               
       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
         -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                 -- ASSIGN  |PARTITIONED|
+                                                                               
                   -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                        -- 
HASH_PARTITION_EXCHANGE [$$127]  |PARTITIONED|
+                                                                          -- 
NESTED_LOOP  |PARTITIONED|
+                                                                            -- 
ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                              
-- UNION_ALL  |PARTITIONED|
+                                                                               
 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
   -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
     -- STREAM_SELECT  |PARTITIONED|
+                                                                               
       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
         -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
             -- SPLIT  |PARTITIONED|
+                                                                               
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                 -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                     -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                         -- ASSIGN  |PARTITIONED|
+                                                                               
                           -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                               
 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
   -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
       -- SPLIT  |PARTITIONED|
+                                                                               
         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
           -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
               -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                            -- 
BROADCAST_EXCHANGE  |PARTITIONED|
+                                                                              
-- UNION_ALL  |PARTITIONED|
+                                                                               
 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
   -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
     -- STREAM_SELECT  |PARTITIONED|
+                                                                               
       -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
           -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
               -- SPLIT  |PARTITIONED|
+                                                                               
                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                   -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                       -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
                         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                           -- ASSIGN  |PARTITIONED|
+                                                                               
                             -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                                                                               
 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
   -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
       -- SPLIT  |PARTITIONED|
+                                                                               
         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
           -- STREAM_PROJECT  |PARTITIONED|
+                                                                               
             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
               -- BTREE_SEARCH  |PARTITIONED|
+                                                                               
                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                                                               
                   -- ASSIGN  |PARTITIONED|
+                                                                               
                     -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I191af547f3142fe5446ead4a2d053ea71e3f1d97
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sjaco...@ucr.edu>

Reply via email to