Skip to content

Commit

Permalink
[fix](jdbc catalog) set enable_jdbc_cast_predicate_push_down defaul…
Browse files Browse the repository at this point in the history
…t true (#44548)

### What problem does this PR solve?

Related PR: #42102

Problem Summary:

We found that after disabling pushdown of predicates with implicit
casts, some users experienced slower queries, so we temporarily changed
this parameter back to the default behavior.
  • Loading branch information
zy-kkk authored and yiguolei committed Dec 1, 2024
1 parent f9b3863 commit 2011074
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; """

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';"""
Expand Down

0 comments on commit 2011074

Please sign in to comment.