Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,17 @@ public double fullEstimateRowCount(RelMetadataQuery mq) {
pw.itemIf("lookup", lookup, true);
return pw;
}

@Override
public boolean deepEquals(@Nullable Object obj) {
boolean deepEquals = super.deepEquals(obj);
if (!deepEquals) {
return deepEquals;
} else if (obj instanceof LogicalIndexFullScan) {
LogicalIndexFullScan that = (LogicalIndexFullScan) obj;
return this.indexId.compareTo((that).indexId) == 0;
} else {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,17 @@ public double estimateRowCount(RelMetadataQuery mq) {
pw.itemIf("lookup", lookup, true);
return pw;
}

@Override
public boolean deepEquals(@Nullable Object obj) {
boolean deepEquals = super.deepEquals(obj);
if (!deepEquals) {
return deepEquals;
} else if (obj instanceof LogicalIndexRangeScan) {
LogicalIndexRangeScan that = (LogicalIndexRangeScan) obj;
return this.indexId.compareTo((that).indexId) == 0;
} else {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import io.dingodb.codec.CodecService;
import io.dingodb.codec.KeyValueCodec;
import io.dingodb.common.CommonId;
import io.dingodb.common.log.LogUtils;
import io.dingodb.common.partition.RangeDistribution;
import io.dingodb.common.type.DingoType;
import io.dingodb.common.type.TupleType;
import io.dingodb.common.util.ByteArrayUtils;
import io.dingodb.common.util.Optional;
import io.dingodb.exec.dag.Vertex;
Expand Down Expand Up @@ -85,10 +88,21 @@ public boolean push(Context context, @Nullable Object[] tuple, Vertex vertex) {
indexTuple[i] = oldIndexTuple[colIx];
}
}
TupleType tupleType = indexTable.tupleType();
KeyValueCodec indexCodec = CodecService.getDefault()
.createKeyValueCodec(indexTable.getCodecVersion(), indexTable.version,
indexTable.tupleType(), indexTable.keyMapping());
partId = indexPs.calcPartId(indexTuple, wrap(indexCodec::encodeKey), param.getDistributions());
tupleType, indexTable.keyMapping());
if (param.getDistributions().isEmpty() && "replicaTable".equalsIgnoreCase(indexTable.getName())) {
return true;
}
try {
partId = indexPs.calcPartId(indexTuple, wrap(indexCodec::encodeKey), param.getDistributions());
} catch (Exception e) {
DingoType[] dingoType = indexTable.tupleType().getFields();
LogUtils.error(log, "indexName:{}, indexTuple:{}, type:{}, keyMapping:{}", indexTable.getName(),
Arrays.toString(indexTuple), Arrays.toString(dingoType), indexTable.keyMapping());
throw e;
}
NavigableMap<ByteArrayUtils.ComparableByteArray, RangeDistribution> distribution =
MetaService.root().getRangeDistribution(param.getTable().tableId);
tablePartId = ps.calcPartId(newTuple, wrap(param.getCodec()::encodeKey), distribution);
Expand Down
Loading