Skip to content
Merged
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
6 changes: 2 additions & 4 deletions src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,7 @@ private ObPair<Long, ObTableParam> getTable(String tableName, Object[] rowKey,
TableEntry tableEntry = getOrRefreshTableEntry(tableName, refresh, waitForRefresh,
needFetchAll);
Row row = new Row();
if (tableEntry.isPartitionTable()
&& tableEntry.getPartitionInfo().getLevel() != ObPartitionLevel.LEVEL_ZERO) {
if (tableEntry.isPartitionTable()) {
List<String> curTableRowKeyNames = new ArrayList<String>();
Map<String, Integer> tableRowKeyEle = getRowKeyElement(tableName);
if (tableRowKeyEle != null) {
Expand Down Expand Up @@ -2052,8 +2051,7 @@ public List<ObPair<Long, ObTableParam>> getTables(String tableName, ObTableQuery
Row startRow = new Row();
Row endRow = new Row();
// ensure the format of column names and values if the current table is a table with partition
if (tableEntry.isPartitionTable()
&& tableEntry.getPartitionInfo().getLevel() != ObPartitionLevel.LEVEL_ZERO) {
if (tableEntry.isPartitionTable()) {
// scanRangeColumn may be longer than start/end in prefix scanning situation
if (scanRangeColumns == null || scanRangeColumns.size() < start.length) {
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,10 @@ private static TableEntry getTableEntryFromRemote(Connection connection, TableEn
if (null != tableEntry) {
tableEntry.setTableEntryKey(key);
// TODO: check capacity flag later
// fetch partition info
fetchPartitionInfo(connection, tableEntry);
// fetch tablet ids when table is partition table
if (tableEntry.isPartitionTable()) {
// fetch partition info
fetchPartitionInfo(connection, tableEntry);
if (null != tableEntry.getPartitionInfo()) {
// fetch first range part
if (null != tableEntry.getPartitionInfo().getFirstPartDesc()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ public Long getReplicaNum() {
* Is partition table.
*/
public boolean isPartitionTable() {
return this.partitionNum > 1;
return partitionNum > 1 || (partitionInfo != null && partitionInfo.getLevel()
.getIndex() > ObPartitionLevel.LEVEL_ZERO.getIndex() && partitionInfo.getLevel()
.getIndex() < ObPartitionLevel.UNKNOWN.getIndex());
}

/*
Expand Down