Skip to content

Commit b3f35e5

Browse files
authored
fix error hbase table name because of the lack of indexTableName (#251)
1 parent 58b69ba commit b3f35e5

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/main/java/com/alipay/oceanbase/rpc/protocol/payload/impl/execute/query/AbstractQueryStreamResult.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,11 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger,
231231
}
232232
} else if (e instanceof ObTableException) {
233233
if ((((ObTableException) e).getErrorCode() == ResultCodes.OB_TABLE_NOT_EXIST.errorCode || ((ObTableException) e)
234-
.getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode)
235-
&& ((request instanceof ObTableQueryAsyncRequest && ((ObTableQueryAsyncRequest) request).getObTableQueryRequest().getTableQuery().isHbaseQuery())
236-
|| (request instanceof ObTableQueryRequest && ((ObTableQueryRequest) request).getTableQuery().isHbaseQuery()))
237-
&& client.getTableGroupInverted().get(indexTableName) != null) {
234+
.getErrorCode() == ResultCodes.OB_NOT_SUPPORTED.errorCode)
235+
&& ((request instanceof ObTableQueryAsyncRequest && ((ObTableQueryAsyncRequest) request)
236+
.getObTableQueryRequest().getTableQuery().isHbaseQuery()) || (request instanceof ObTableQueryRequest && ((ObTableQueryRequest) request)
237+
.getTableQuery().isHbaseQuery()))
238+
&& client.getTableGroupInverted().get(indexTableName) != null) {
238239
// table not exists && hbase mode && table group exists , three condition both
239240
client.eraseTableGroupFromCache(tableName);
240241
}
@@ -254,7 +255,7 @@ protected ObPayload commonExecute(ObTableClient client, Logger logger,
254255
((ObTableException) e).getErrorCode(), tryTimes, e);
255256
// tablet not exists, refresh table entry
256257
if (e instanceof ObTableNeedFetchAllException) {
257-
client.getOrRefreshTableEntry(tableName, true, true, true);
258+
client.getOrRefreshTableEntry(indexTableName, true, true, true);
258259
throw e;
259260
}
260261
} else {

src/main/java/com/alipay/oceanbase/rpc/table/ObTableClientQueryImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ public Map<Long, ObPair<Long, ObTableParam>> initPartitions(ObTableQuery tableQu
241241

242242
if (!this.obTableClient.isOdpMode()) {
243243
indexTableName = obTableClient.getIndexTableName(tableName, indexName, tableQuery.getScanRangeColumns(), false);
244+
this.indexTableName = indexTableName;
244245
}
245246

246247
for (ObNewRange range : tableQuery.getKeyRanges()) {
@@ -262,6 +263,7 @@ public Map<Long, ObPair<Long, ObTableParam>> initPartitions(ObTableQuery tableQu
262263
}
263264
if (this.entityType == ObTableEntityType.HKV && obTableClient.isTableGroupName(tableName)) {
264265
indexTableName = obTableClient.tryGetTableNameFromTableGroupCache(tableName, false);
266+
this.indexTableName = indexTableName;
265267
}
266268
ObBorderFlag borderFlag = range.getBorderFlag();
267269
List<ObPair<Long, ObTableParam>> pairs = this.obTableClient.getTables(indexTableName,

0 commit comments

Comments
 (0)