This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new e3229552863 branch-2.1: [fix](jdbc catalog) set
`enable_jdbc_cast_predicate_push_down` default true #44548 (#44760)
e3229552863 is described below
commit e322955286318f27ffc40093ddda9d0eb3308af2
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Dec 2 09:33:46 2024 +0800
branch-2.1: [fix](jdbc catalog) set `enable_jdbc_cast_predicate_push_down`
default true #44548 (#44760)
Cherry-picked from #44548
Co-authored-by: zy-kkk <[email protected]>
---
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java | 2 +-
.../external_table_p0/jdbc/test_clickhouse_jdbc_catalog.groovy | 6 ------
.../external_table_p0/jdbc/test_jdbc_catalog_push_cast.groovy | 2 ++
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index f3e6eea6756..48e18978d72 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -686,7 +686,7 @@ public class SessionVariable implements Serializable,
Writable {
@VariableMgr.VarAttr(name = ENABLE_JDBC_CAST_PREDICATE_PUSH_DOWN,
needForward = true,
description = {"是否允许将带有 CAST 表达式的谓词下推到 JDBC 外部表。",
"Whether to allow predicates with CAST expressions to be
pushed down to JDBC external tables."})
- public boolean enableJdbcCastPredicatePushDown = false;
+ public boolean enableJdbcCastPredicatePushDown = true;
@VariableMgr.VarAttr(name = ROUND_PRECISE_DECIMALV2_VALUE)
public boolean roundPreciseDecimalV2Value = false;
diff --git
a/regression-test/suites/external_table_p0/jdbc/test_clickhouse_jdbc_catalog.groovy
b/regression-test/suites/external_table_p0/jdbc/test_clickhouse_jdbc_catalog.groovy
index 23e37184feb..2b427e2eec2 100644
---
a/regression-test/suites/external_table_p0/jdbc/test_clickhouse_jdbc_catalog.groovy
+++
b/regression-test/suites/external_table_p0/jdbc/test_clickhouse_jdbc_catalog.groovy
@@ -82,17 +82,11 @@ suite("test_clickhouse_jdbc_catalog",
"p0,external,clickhouse,external_docker,ex
sql("select * from ts where from_unixtime(ts,'yyyyMMdd') >=
'2022-01-01';")
contains """QUERY: SELECT "id", "ts" FROM "doris_test"."ts" WHERE
((FROM_UNIXTIME("ts", '%Y%m%d') >= '2022-01-01'))"""
}
- explain {
- sql("select * from ts where nvl(ts,null) >= '1';")
- contains """QUERY: SELECT "id", "ts" FROM "doris_test"."ts"""
- }
order_qt_func_push2 """select * from ts where ts <=
unix_timestamp(from_unixtime(ts,'yyyyMMdd'));"""
- sql "set enable_jdbc_cast_predicate_push_down = true;"
explain {
sql("select * from ts where ts <=
unix_timestamp(from_unixtime(ts,'yyyy-MM-dd'));")
contains """QUERY: SELECT "id", "ts" FROM "doris_test"."ts" WHERE
(("ts" <= toUnixTimestamp(FROM_UNIXTIME("ts", '%Y-%m-%d'))))"""
}
- sql "set enable_jdbc_cast_predicate_push_down = false;"
order_qt_dt_with_tz """ select * from dt_with_tz order by id; """
diff --git
a/regression-test/suites/external_table_p0/jdbc/test_jdbc_catalog_push_cast.groovy
b/regression-test/suites/external_table_p0/jdbc/test_jdbc_catalog_push_cast.groovy
index 6271a1619a5..3585f5fbb50 100644
---
a/regression-test/suites/external_table_p0/jdbc/test_jdbc_catalog_push_cast.groovy
+++
b/regression-test/suites/external_table_p0/jdbc/test_jdbc_catalog_push_cast.groovy
@@ -34,6 +34,8 @@ suite("test_jdbc_catalog_push_cast",
"p0,external,mysql,external_docker,external
"driver_class" = "com.mysql.cj.jdbc.Driver"
);"""
+ sql "set enable_jdbc_cast_predicate_push_down = false;"
+
sql "use jdbc_catalog_push_cast.doris_test"
qt_sql """select * from test_cast where date(datetime_c) =
'2022-01-01';"""
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]