|
17 | 17 |
|
18 | 18 | package com.alipay.oceanbase.rpc.table; |
19 | 19 |
|
| 20 | +import com.alipay.oceanbase.rpc.ObGlobal; |
20 | 21 | import com.alipay.oceanbase.rpc.ObTableClient; |
| 22 | +import com.alipay.oceanbase.rpc.exception.FeatureNotSupportedException; |
21 | 23 | import com.alipay.oceanbase.rpc.exception.ObTableException; |
22 | 24 | import com.alipay.oceanbase.rpc.location.model.partition.ObPair; |
23 | 25 | import com.alipay.oceanbase.rpc.mutation.Row; |
@@ -129,6 +131,15 @@ public void checkArgumentBeforeExec() throws Exception { |
129 | 131 | throw new ObTableException("offset can not be use without limit"); |
130 | 132 | } else if (tableName == null || tableName.isEmpty()) { |
131 | 133 | throw new IllegalArgumentException("table name is null"); |
| 134 | + } else if (tableQuery.isFTSQuery()) { |
| 135 | + if (!ObGlobal.isFtsQuerySupport()) { |
| 136 | + throw new FeatureNotSupportedException("full text query is not supported in "+ObGlobal.OB_VERSION); |
| 137 | + } |
| 138 | + if (tableQuery.getIndexName() == null || tableQuery.getIndexName().isEmpty() |
| 139 | + || tableQuery.getIndexName().equalsIgnoreCase("primary")) { |
| 140 | + throw new IllegalArgumentException( |
| 141 | + "use fulltext search but specified index name is not fulltext index"); |
| 142 | + } |
132 | 143 | } |
133 | 144 | } |
134 | 145 |
|
@@ -159,15 +170,6 @@ private AbstractQueryStreamResult commonExecute(InitQueryResultCallback<Abstract |
159 | 170 | // fill a whole range if no range is added explicitly. |
160 | 171 | if (tableQuery.getKeyRanges().isEmpty()) { |
161 | 172 | tableQuery.addKeyRange(ObNewRange.getWholeRange()); |
162 | | - } else if (tableQuery.isFTSQuery()) { |
163 | | - // Currently, fulltext query only support scan all partitions |
164 | | - tableQuery.getKeyRanges().clear(); |
165 | | - tableQuery.addKeyRange(ObNewRange.getWholeRange()); |
166 | | - if (tableQuery.getIndexName() == null || tableQuery.getIndexName().isEmpty() |
167 | | - || tableQuery.getIndexName().equalsIgnoreCase("primary")) { |
168 | | - throw new IllegalArgumentException( |
169 | | - "use fulltext search but specified index name is not fulltext index"); |
170 | | - } |
171 | 173 | } |
172 | 174 |
|
173 | 175 | // init partitionObTables |
|
0 commit comments