github-actions[bot] commented on code in PR #68200:
URL: https://github.com/apache/doris/pull/68200#discussion_r4266364784


##########
fe/fe-connector/fe-connector-jdbc/src/main/java/org/apache/doris/connector/jdbc/client/JdbcOracleConnectorClient.java:
##########
@@ -171,6 +171,9 @@ public ConnectorType jdbcTypeToConnectorType(JdbcFieldInfo 
fieldInfo) {
                 }
                 return createDecimalOrString(scale, scale);
             }
+            case "BINARY_FLOAT":
+                return ConnectorType.of("FLOAT");

Review Comment:
   [P1] Preserve DOUBLE promotion in binary-float arithmetic pushdown
   
   The new BINARY_FLOAT mapping admits a predicate such as `bf1 + bf2 > bf1`, 
with independent BINARY_FLOAT columns containing 16777216 and 1. The reduced 
Doris plan promotes both arithmetic operands to DOUBLE:
   
   ```text
   Filter(CAST(bf1 AS DOUBLE) + CAST(bf2 AS DOUBLE) > CAST(bf1 AS DOUBLE))
     Scan(Oracle table: bf1 FLOAT, bf2 FLOAT)
   ```
   
   `TypeCoercionUtils.processBinaryArithmetic` applies FLOAT-to-DOUBLE 
promotion, so Doris computes 16777217 and keeps the row. Default JDBC cast 
pushdown permits this conjunct, but `ExprToConnectorExpressionConverter` strips 
those casts and `JdbcQueryBuilder` emits `("BF1" + "BF2") > "BF1"`. Oracle 
evaluates these operands and the result as BINARY_FLOAT ([arithmetic 
rules](https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/Arithmetic-Operators.html)),
 rounds the sum to 16777216, and discards the row before BE can recheck it. 
This needs no special literal or zero divisor, so the existing 
literal-rendering/division findings do not cover it. Preserve the required 
DOUBLE coercions in the remote SQL or keep affected arithmetic conjuncts local, 
and add an Oracle regression for this case.



-- 
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