Skip to content

Commit ccba930

Browse files
guojn1ketor
authored andcommitted
[fix][dingo-exec] Add log to Fix batch Sql Exception: table cast to indexTable
1 parent 346f39d commit ccba930

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

dingo-exec/src/main/java/io/dingodb/exec/transaction/util/TransactionUtil.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,16 @@ public static Map<CommonId, List<byte[]>> multiKeySplitRegionId(CommonId tableId
126126
public static IndexTable getIndexDefinitions(CommonId tableId) {
127127
MetaService root = MetaService.root();
128128
Table table = root.getTable(tableId);
129-
if (!(table instanceof IndexTable)) {
130-
LogUtils.error(log, "except indexTable, bug not, tableId:{}, act table", tableId, table);
129+
if (table == null) {
130+
LogUtils.error(log, "expect indexTable, bug is not, indexTableId:{}, act table is null", tableId);
131+
} else if (!(table instanceof IndexTable)) {
132+
LogUtils.error(log, "expect indexTable, bug is not, indexTableId:{}, act table:{}", tableId, table);
133+
List<IndexTable> indexTableList = table.getIndexes();
134+
if (indexTableList != null && !indexTableList.isEmpty()) {
135+
indexTableList.forEach(indexTable -> {
136+
LogUtils.error(log, "expect indexTable, bug is not, tableId:{}, loop indexId:{}", tableId, indexTable.getTableId());
137+
});
138+
}
131139
}
132140
return (IndexTable) table;
133141
}

0 commit comments

Comments
 (0)