You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by al...@apache.org on 2019/05/02 23:29:11 UTC

[asterixdb] branch master updated: [NO ISSUE][HYR][RT] Handle calls to close() properly in hash join

This is an automated email from the ASF dual-hosted git repository.

alsuliman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 36379d0  [NO ISSUE][HYR][RT] Handle calls to close() properly in hash join
36379d0 is described below

commit 36379d052e1789be2ef415bd1742dd45ac4a7f7b
Author: Ali Alsuliman <al...@gmail.com>
AuthorDate: Wed May 1 20:08:40 2019 -0700

    [NO ISSUE][HYR][RT] Handle calls to close() properly in hash join
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    Hash join build activity assumes that upon calling close()
    the join state must have been allocated in open() and
    therefore, it will directly call "close build" using the join
    state. However, if the build activity throws an exception
    in open(), then it could happen that the join state has
    not been initialized. Calling close() on the build activity
    will lead to a NPE since it will use the join state directly.
    This patch checks if the join state has been initialized. If
    so, it will close the build as usual.
    
    Change-Id: I41fff7deed5e56818bfefb4d36b8018a9f512cbb
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/3375
    Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Murtadha Hubail <mh...@apache.org>
---
 .../join/OptimizedHybridHashJoinOperatorDescriptor.java  | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java
index 403c492..81d08b2 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/OptimizedHybridHashJoinOperatorDescriptor.java
@@ -315,13 +315,15 @@ public class OptimizedHybridHashJoinOperatorDescriptor extends AbstractOperatorD
 
                 @Override
                 public void close() throws HyracksDataException {
-                    state.hybridHJ.closeBuild();
-                    if (isFailed) {
-                        state.hybridHJ.clearBuildTempFiles();
-                    } else {
-                        ctx.setStateObject(state);
-                        if (LOGGER.isTraceEnabled()) {
-                            LOGGER.trace("OptimizedHybridHashJoin closed its build phase");
+                    if (state.hybridHJ != null) {
+                        state.hybridHJ.closeBuild();
+                        if (isFailed) {
+                            state.hybridHJ.clearBuildTempFiles();
+                        } else {
+                            ctx.setStateObject(state);
+                            if (LOGGER.isTraceEnabled()) {
+                                LOGGER.trace("OptimizedHybridHashJoin closed its build phase");
+                            }
                         }
                     }
                 }