morningman commented on code in PR #42102:
URL: https://github.com/apache/doris/pull/42102#discussion_r1807796924


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/source/JdbcScanNode.java:
##########
@@ -138,6 +139,11 @@ private void createJdbcFilters() {
     private List<Expr> collectConjunctsToPushDown(List<Expr> conjunctsList, 
List<String> errors) {
         List<Expr> pushDownConjuncts = new ArrayList<>();
         for (Expr p : conjunctsList) {
+            if (ConnectContext.get() != null && 
!ConnectContext.get().getSessionVariable().jdbcCastExprPushdown) {

Review Comment:
   And why not write this logic in `shouldPushDownConjunct()`?



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/source/JdbcScanNode.java:
##########
@@ -138,6 +139,11 @@ private void createJdbcFilters() {
     private List<Expr> collectConjunctsToPushDown(List<Expr> conjunctsList, 
List<String> errors) {
         List<Expr> pushDownConjuncts = new ArrayList<>();
         for (Expr p : conjunctsList) {
+            if (ConnectContext.get() != null && 
!ConnectContext.get().getSessionVariable().jdbcCastExprPushdown) {

Review Comment:
   If `ConnectContext.get()` is null, I think we should also disallow to push 
down cast expr



##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -504,6 +504,8 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String JDBC_ORACLE_NULL_PREDICATE_PUSHDOWN = 
"jdbc_oracle_null_predicate_pushdown";
 
+    public static final String JDBC_CAST_EXPR_PUSHDOWN = 
"jdbc_cast_expr_pushdown";

Review Comment:
   ```suggestion
       public static final String JDBC_CAST_EXPR_PUSHDOWN = 
"enable_jdbc_push_down_cast_expr";
   ```
   
   So that we can unify the variable name like `enable_jdbc_push_down_xxx`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to