Skip to content

Commit

Permalink
[ASTERIXDB-2800] Added exception for in-mem join
Browse files Browse the repository at this point in the history
    - 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 <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Tested-by: Michael Blow <mblow@apache.org>
  • Loading branch information
shivajah authored and AliSolaiman committed Nov 25, 2020
1 parent 3759a6c commit 92c0a16
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -32,6 +32,7 @@
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;
Expand Down Expand Up @@ -124,8 +125,10 @@ public void build(ByteBuffer buffer) throws HyracksDataException {
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.");
}
}
}
}
Expand Down

0 comments on commit 92c0a16

Please sign in to comment.