[fix](jdbc catalog)fixed oceanbase catalog row limit bug (#19796)

This commit is contained in:
yongkang.zhong
2023-05-18 22:05:51 +08:00
committed by GitHub
parent 40ab4ce305
commit f2b2a568de

View File

@ -162,7 +162,8 @@ public class JdbcScanNode extends ScanNode {
StringBuilder sql = new StringBuilder("SELECT ");
// Oracle use the where clause to do top n
if (shouldPushDownLimit() && jdbcType == TOdbcTableType.ORACLE) {
if (shouldPushDownLimit() && (jdbcType == TOdbcTableType.ORACLE
|| jdbcType == TOdbcTableType.OCEANBASE_ORACLE)) {
filters.add("ROWNUM <= " + limit);
}
@ -187,7 +188,8 @@ public class JdbcScanNode extends ScanNode {
|| jdbcType == TOdbcTableType.MONGODB
|| jdbcType == TOdbcTableType.CLICKHOUSE
|| jdbcType == TOdbcTableType.SAP_HANA
|| jdbcType == TOdbcTableType.TRINO)) {
|| jdbcType == TOdbcTableType.TRINO
|| jdbcType == TOdbcTableType.OCEANBASE)) {
sql.append(" LIMIT ").append(limit);
}