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
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,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 @@ -83,17 +83,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
Loading