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

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

commit 92c0a1633958ff35877490dba1b9d747903a8c70
Author: Shiva <[email protected]>
AuthorDate: Tue Nov 24 18:58:32 2020 -0800

    [ASTERIXDB-2800] Added exception for in-mem join
    
        - user model changes: no
        - storage format changes: no
        - interface changes: no
    
        Details:
        - Exception is thrown if the record insertion in
        hash table of the in-memory hash join fails after
        compacting it.
    
    Change-Id: I37e4b7209b5e9e31b9082f0ad04fbe611354da5f
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/9045
    Integration-Tests: Jenkins <[email protected]>
    Reviewed-by: Michael Blow <[email protected]>
    Tested-by: Michael Blow <[email protected]>
---
 .../org/apache/hyracks/dataflow/std/join/InMemoryHashJoin.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/InMemoryHashJoin.java
 
b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/InMemoryHashJoin.java
index 4b1e4aa..cb63b6a 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/InMemoryHashJoin.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/join/InMemoryHashJoin.java
@@ -32,6 +32,7 @@ import 
org.apache.hyracks.api.dataflow.value.IPredicateEvaluator;
 import org.apache.hyracks.api.dataflow.value.ITuplePairComparator;
 import org.apache.hyracks.api.dataflow.value.ITuplePartitionComputer;
 import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
+import org.apache.hyracks.api.exceptions.ErrorCode;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
@@ -124,8 +125,10 @@ public class InMemoryHashJoin {
             storedTuplePointer.reset(bIndex, i);
             // If an insertion fails, then tries to insert the same tuple 
pointer again after compacting the table.
             if (!table.insert(entry, storedTuplePointer)) {
-                // TODO(ali): should check if insertion failed even after 
compaction and take action
-                compactTableAndInsertAgain(entry, storedTuplePointer);
+                if (!compactTableAndInsertAgain(entry, storedTuplePointer)) {
+                    throw HyracksDataException.create(ErrorCode.ILLEGAL_STATE,
+                            "Record insertion failed in in-memory hash join 
even after compaction.");
+                }
             }
         }
     }

Reply via email to