use of com.hazelcast.jet.sql.impl.ObjectArrayKey in project hazelcast by hazelcast.
the class SqlHashJoinP method tryProcess1.
@Override
protected boolean tryProcess1(@Nonnull Object item) {
if (hashMap.size() == maxItemsInHashTable) {
throw new AccumulationLimitExceededException();
}
JetSqlRow rightRow = (JetSqlRow) item;
ObjectArrayKey joinKeys = ObjectArrayKey.project(rightRow, joinInfo.rightEquiJoinIndices());
// if there's a null in the key, then `null = null` is UNKNOWN in SQL, ignore such keys
if (joinKeys.containsNull()) {
return true;
}
hashMap.put(joinKeys, rightRow);
return true;
}
use of com.hazelcast.jet.sql.impl.ObjectArrayKey in project hazelcast by hazelcast.
the class SqlHashJoinP method join.
private Traverser<JetSqlRow> join(JetSqlRow leftRow) {
ObjectArrayKey joinKeys = ObjectArrayKey.project(leftRow, joinInfo.leftEquiJoinIndices());
Collection<JetSqlRow> matchedRows = hashMap.get(joinKeys);
List<JetSqlRow> output = matchedRows.stream().map(right -> ExpressionUtil.join(leftRow, right, joinInfo.nonEquiCondition(), evalContext)).filter(Objects::nonNull).collect(Collectors.toList());
if (joinInfo.isLeftOuter() && output.isEmpty()) {
return Traversers.singleton(leftRow.extendedRow(rightInputColumnCount));
}
return Traversers.traverseIterable(output);
}
Aggregations