in athena-federation-sdk/src/main/java/com/amazonaws/athena/connector/lambda/data/Block.java [428:474]
public boolean equalsAsSet(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Block that = (Block) o;
if (this.schema.getFields().size() != that.schema.getFields().size()) {
return false;
}
if (this.vectorSchema.getRowCount() != that.vectorSchema.getRowCount()) {
return false;
}
try {
for (Field next : this.schema.getFields()) {
FieldReader thisReader = vectorSchema.getVector(next.getName()).getReader();
FieldReader thatReader = that.vectorSchema.getVector(next.getName()).getReader();
for (int i = 0; i < this.vectorSchema.getRowCount(); i++) {
thisReader.setPosition(i);
Types.MinorType type = thisReader.getMinorType();
Object val = thisReader.readObject();
boolean matched = false;
for (int j = 0; j < that.vectorSchema.getRowCount(); j++) {
thatReader.setPosition(j);
if (ArrowTypeComparator.compare(thatReader, val, thatReader.readObject()) == 0) {
matched = true;
}
}
if (!matched) {
return false;
}
}
}
}
catch (RuntimeException ex) {
//There are many differences which can cause an exception, easier to handle them this way
return false;
}
return true;
}