shamim8888 / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

Hyracks Job creation Failure #888

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Note: this bug as presented will only show up on my branch (caused after fixes 
for Issues 874,876, 886, and 887 are overcome)

Here is the query:
for $sub in dataset NearbySheltersDuringTornadoDangerChannelSubscriptions
let $timewindow := day-time-duration("PT10M")
for $emergency in dataset CHPReports
where $emergency.timestamp >= current-datetime()-$timewindow
where $emergency.etype = "tornado"
let $dangerzone := create-circle($emergency.epicenter,$emergency.radius)
where (some $user in dataset userLocations satisfies
            $user.user-id = $sub.param0
            and $user.timestamp >= current-datetime() - $timewindow
            and spatial-intersect($dangerzone,$user.location))
return {
"message":$emergency.message,
"shelter locations":for $shelter in dataset tornadoShelters where 
spatial-intersect($shelter.location,$dangerzone) return $shelter.location
};

Here is the optimized Asterix Plan:
distribute result [%0->$$30]
-- DISTRIBUTE_RESULT  |PARTITIONED|
  exchange 
  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
    project ([$$30])
    -- STREAM_PROJECT  |PARTITIONED|
      assign [$$30] <- [function-call: asterix:closed-record-constructor, Args:[AString: {message}, %0->$$58, AString: {shelter locations}, %0->$$36]]
      -- ASSIGN  |PARTITIONED|
        project ([$$36, $$58])
        -- STREAM_PROJECT  |PARTITIONED|
          exchange 
          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
            group by ([$$39 := %0->$$49]) decor ([$$58 := %0->$$59]) {
                      aggregate [$$36] <- [function-call: asterix:listify, Args:[%0->$$37]]
                      -- AGGREGATE  |LOCAL|
                        select (function-call: algebricks:not, Args:[function-call: algebricks:is-null, Args:[%0->$$48]])
                        -- STREAM_SELECT  |LOCAL|
                          nested tuple source
                          -- NESTED_TUPLE_SOURCE  |LOCAL|
                   }
            -- PRE_CLUSTERED_GROUP_BY[$$49]  |PARTITIONED|
              exchange 
              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                order (ASC, %0->$$49) 
                -- STABLE_SORT [$$49(ASC)]  |PARTITIONED|
                  exchange 
                  -- HASH_PARTITION_EXCHANGE [$$49]  |PARTITIONED|
                    project ([$$49, $$48, $$37, $$59])
                    -- STREAM_PROJECT  |PARTITIONED|
                      exchange 
                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                        left outer join (function-call: asterix:spatial-intersect, Args:[%0->$$37, %0->$$3])
                        -- NESTED_LOOP  |PARTITIONED|
                          exchange 
                          -- BROADCAST_EXCHANGE  |PARTITIONED|
                            project ([$$49, $$3, $$59])
                            -- STREAM_PROJECT  |PARTITIONED|
                              select (%0->$$29)
                              -- STREAM_SELECT  |PARTITIONED|
                                project ([$$49, $$3, $$59, $$29])
                                -- STREAM_PROJECT  |PARTITIONED|
                                  exchange 
                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                    group by ([$$38 := %0->$$46; $$49 := %0->$$47]) decor ([$$3 := %0->$$45; $$59 := %0->$$60]) {
                                              aggregate [$$29] <- [function-call: asterix:non-empty-stream, Args:[]]
                                              -- AGGREGATE  |LOCAL|
                                                select (function-call: algebricks:not, Args:[function-call: algebricks:is-null, Args:[%0->$$42]])
                                                -- STREAM_SELECT  |LOCAL|
                                                  nested tuple source
                                                  -- NESTED_TUPLE_SOURCE  |LOCAL|
                                           }
                                    -- PRE_CLUSTERED_GROUP_BY[$$46, $$47]  |PARTITIONED|
                                      exchange 
                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                        order (ASC, %0->$$46) (ASC, %0->$$47) 
                                        -- STABLE_SORT [$$46(ASC), $$47(ASC)]  |PARTITIONED|
                                          exchange 
                                          -- HASH_PARTITION_EXCHANGE [$$46, $$47]  |PARTITIONED|
                                            project ([$$42, $$46, $$47, $$45, $$60])
                                            -- STREAM_PROJECT  |PARTITIONED|
                                              exchange 
                                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                left outer join (function-call: algebricks:and, Args:[function-call: asterix:spatial-intersect, Args:[%0->$$45, %0->$$57], function-call: algebricks:eq, Args:[%0->$$50, %0->$$51]])
                                                -- NESTED_LOOP  |PARTITIONED|
                                                  exchange 
                                                  -- BROADCAST_EXCHANGE  |PARTITIONED|
                                                    join (TRUE)
                                                    -- NESTED_LOOP  |PARTITIONED|
                                                      exchange 
                                                      -- BROADCAST_EXCHANGE  |PARTITIONED|
                                                        project ([$$51, $$46])
                                                        -- STREAM_PROJECT  |PARTITIONED|
                                                          assign [$$51] <- [function-call: asterix:field-access-by-index, Args:[%0->$$43, AInt32: {1}]]
                                                          -- ASSIGN  |PARTITIONED|
                                                            exchange 
                                                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                              data-scan []<-[$$46, $$43] <- emergencyTest:NearbySheltersDuringTornadoDangerChannelSubscriptions
                                                              -- DATASOURCE_SCAN  |PARTITIONED|
                                                                exchange 
                                                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                  empty-tuple-source
                                                                  -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
                                                      exchange 
                                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                        project ([$$47, $$45, $$60])
                                                        -- STREAM_PROJECT  |PARTITIONED|
                                                          assign [$$45] <- [function-call: asterix:create-circle, Args:[function-call: asterix:field-access-by-index, Args:[%0->$$44, AInt32: {1}], function-call: asterix:field-access-by-index, Args:[%0->$$44, AInt32: {2}]]]
                                                          -- ASSIGN  |PARTITIONED|
                                                            select (function-call: algebricks:and, Args:[function-call: algebricks:ge, Args:[function-call: asterix:field-access-by-index, Args:[%0->$$44, AInt32: {4}], ADateTime: { 2015-05-19T22:30:58.654Z }], function-call: algebricks:eq, Args:[function-call: asterix:field-access-by-name, Args:[%0->$$44, AString: {etype}], AString: {tornado}]])
                                                            -- STREAM_SELECT  |PARTITIONED|
                                                              assign [$$60] <- [function-call: asterix:field-access-by-index, Args:[%0->$$44, AInt32: {3}]]
                                                              -- ASSIGN  |PARTITIONED|
                                                                exchange 
                                                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                  unnest-map [$$47, $$44] <- function-call: asterix:index-search, Args:[AString: {CHPReports}, AInt32: {0}, AString: {emergencyTest}, AString: {CHPReports}, ABoolean: {false}, ABoolean: {false}, ABoolean: {false}, AInt32: {1}, %0->$$63, AInt32: {1}, %0->$$63, TRUE, TRUE, TRUE]
                                                                  -- BTREE_SEARCH  |PARTITIONED|
                                                                    exchange 
                                                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                      order (ASC, %0->$$63) 
                                                                      -- STABLE_SORT [$$63(ASC)]  |PARTITIONED|
                                                                        exchange 
                                                                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                          project ([$$63])
                                                                          -- STREAM_PROJECT  |PARTITIONED|
                                                                            exchange 
                                                                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                              unnest-map [$$62, $$63] <- function-call: asterix:index-search, Args:[AString: {times}, AInt32: {0}, AString: {emergencyTest}, AString: {CHPReports}, ABoolean: {false}, ABoolean: {false}, ABoolean: {false}, AInt32: {1}, %0->$$61, AInt32: {0}, TRUE, TRUE, FALSE]
                                                                              -- BTREE_SEARCH  |PARTITIONED|
                                                                                exchange 
                                                                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                  replicate 
                                                                                  -- SPLIT  |PARTITIONED|
                                                                                    exchange 
                                                                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                      assign [$$61] <- [ADateTime: { 2015-05-19T22:30:58.654Z }]
                                                                                      -- ASSIGN  |PARTITIONED|
                                                                                        empty-tuple-source
                                                                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
                                                  exchange 
                                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                    assign [$$42] <- [TRUE]
                                                    -- ASSIGN  |PARTITIONED|
                                                      project ([$$50, $$57])
                                                      -- STREAM_PROJECT  |PARTITIONED|
                                                        select (function-call: algebricks:ge, Args:[function-call: asterix:field-access-by-index, Args:[%0->$$4, AInt32: {3}], ADateTime: { 2015-05-19T22:30:58.654Z }])
                                                        -- STREAM_SELECT  |PARTITIONED|
                                                          assign [$$57, $$50] <- [function-call: asterix:field-access-by-index, Args:[%0->$$4, AInt32: {2}], function-call: asterix:field-access-by-index, Args:[%0->$$4, AInt32: {1}]]
                                                          -- ASSIGN  |PARTITIONED|
                                                            project ([$$4])
                                                            -- STREAM_PROJECT  |PARTITIONED|
                                                              exchange 
                                                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                unnest-map [$$40, $$4] <- function-call: asterix:index-search, Args:[AString: {userLocations}, AInt32: {0}, AString: {emergencyTest}, AString: {userLocations}, ABoolean: {false}, ABoolean: {false}, ABoolean: {false}, AInt32: {1}, %0->$$66, AInt32: {1}, %0->$$66, TRUE, TRUE, TRUE]
                                                                -- BTREE_SEARCH  |PARTITIONED|
                                                                  exchange 
                                                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                    order (ASC, %0->$$66) 
                                                                    -- STABLE_SORT [$$66(ASC)]  |PARTITIONED|
                                                                      exchange 
                                                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                        project ([$$66])
                                                                        -- STREAM_PROJECT  |PARTITIONED|
                                                                          exchange 
                                                                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                            unnest-map [$$65, $$66] <- function-call: asterix:index-search, Args:[AString: {times2}, AInt32: {0}, AString: {emergencyTest}, AString: {userLocations}, ABoolean: {false}, ABoolean: {false}, ABoolean: {false}, AInt32: {1}, %0->$$64, AInt32: {0}, TRUE, TRUE, FALSE]
                                                                            -- BTREE_SEARCH  |PARTITIONED|
                                                                              project ([$$64])
                                                                              -- STREAM_PROJECT  |PARTITIONED|
                                                                                assign [$$64] <- [%0->$$61]
                                                                                -- ASSIGN  |PARTITIONED|
                                                                                  exchange 
                                                                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                    replicate 
                                                                                    -- SPLIT  |PARTITIONED|
                                                                                      exchange 
                                                                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                        assign [$$61] <- [ADateTime: { 2015-05-19T22:30:58.654Z }]
                                                                                        -- ASSIGN  |PARTITIONED|
                                                                                          empty-tuple-source
                                                                                          -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
                          exchange 
                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                            project ([$$48, $$37])
                            -- STREAM_PROJECT  |PARTITIONED|
                              assign [$$48, $$37] <- [TRUE, function-call: asterix:field-access-by-index, Args:[%0->$$5, AInt32: {1}]]
                              -- ASSIGN  |PARTITIONED|
                                project ([$$5])
                                -- STREAM_PROJECT  |PARTITIONED|
                                  exchange 
                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                    data-scan []<-[$$41, $$5] <- emergencyTest:tornadoShelters
                                    -- DATASOURCE_SCAN  |PARTITIONED|
                                      exchange 
                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                        empty-tuple-source
                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

Here is the exception:
java.lang.NullPointerException
    at edu.uci.ics.hyracks.api.job.JobSpecification.getInputConnectorDescriptor(JobSpecification.java:187)
    at edu.uci.ics.hyracks.api.job.JobSpecification.getInputConnectorDescriptor(JobSpecification.java:183)
    at edu.uci.ics.hyracks.api.client.impl.JobActivityGraphBuilder.addSourceEdge(JobActivityGraphBuilder.java:77)
    at edu.uci.ics.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor.contributeActivities(AbstractSingleActivityOperatorDescriptor.java:41)
    at edu.uci.ics.hyracks.api.client.impl.JobSpecificationActivityClusterGraphGeneratorFactory$2.visit(JobSpecificationActivityClusterGraphGeneratorFactory.java:63)
    at edu.uci.ics.hyracks.api.client.impl.PlanUtils.visitOperator(PlanUtils.java:37)
    at edu.uci.ics.hyracks.api.client.impl.PlanUtils.visit(PlanUtils.java:30)

Original issue reported on code.google.com by sjaco...@ucr.edu on 19 May 2015 at 10:46

GoogleCodeExporter commented 8 years ago

Original comment by sjaco...@ucr.edu on 19 May 2015 at 10:47

GoogleCodeExporter commented 8 years ago
Just discovered that this failure is sporadic, and that it actually produces a 
different optimized Algebricks plan in the times that it fails. Is it supposed 
to be possible for the optimized plan to be nondeterministic?
The difference in the plan is here:
When it works we have 
                                                                          project ([$$63])
                                                                          -- STREAM_PROJECT  |PARTITIONED|
                                                                            exchange 
                                                                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                              unnest-map [$$62, $$63] <- function-call: asterix:index-search, Args:[AString: {times}, AInt32: {0}, AString: {emergencyTest}, AString: {CHPReports}, ABoolean: {false}, ABoolean: {false}, ABoolean: {false}, AInt32: {1}, %0->$$61, AInt32: {0}, TRUE, TRUE, FALSE]
                                                                              -- BTREE_SEARCH  |PARTITIONED|
                                                                                exchange 
                                                                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                  assign [$$61] <- [ADateTime: { 2015-05-20T21:42:19.365Z }]
                                                                                  -- ASSIGN  |PARTITIONED|
                                                                                    empty-tuple-source
                                                                                    -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
When it fails we have:
                                                                          project ([$$63])
                                                                          -- STREAM_PROJECT  |PARTITIONED|
                                                                            exchange 
                                                                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                              unnest-map [$$62, $$63] <- function-call: asterix:index-search, Args:[AString: {times}, AInt32: {0}, AString: {emergencyTest}, AString: {CHPReports}, ABoolean: {false}, ABoolean: {false}, ABoolean: {false}, AInt32: {1}, %0->$$61, AInt32: {0}, TRUE, TRUE, FALSE]
                                                                              -- BTREE_SEARCH  |PARTITIONED|
                                                                                exchange 
                                                                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                  replicate 
                                                                                  -- SPLIT  |PARTITIONED|
                                                                                    exchange 
                                                                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                      assign [$$61] <- [ADateTime: { 2015-05-20T21:44:31.633Z }]
                                                                                      -- ASSIGN  |PARTITIONED|
                                                                                        empty-tuple-source
                                                                                        -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

So sometimes a replicate exchange happens and sometimes not...

Original comment by sjaco...@ucr.edu on 20 May 2015 at 9:59