github-actions[bot] commented on code in PR #68200:
URL: https://github.com/apache/doris/pull/68200#discussion_r4056545350
##########
fe/fe-connector/fe-connector-jdbc/src/main/java/org/apache/doris/connector/jdbc/client/JdbcOracleConnectorClient.java:
##########
@@ -177,6 +177,9 @@ public ConnectorType jdbcTypeToConnectorType(JdbcFieldInfo
fieldInfo) {
}
return createDecimalOrString(scale, scale);
}
+ case "BINARY_FLOAT":
+ return ConnectorType.of("FLOAT");
+ case "BINARY_DOUBLE":
Review Comment:
[P1] Preserve finite binary-float predicates outside the long range
These cases make large finite Oracle binary values reachable. After constant
folding, `CAST('1e20' AS DOUBLE)` reaches `JdbcQueryBuilder.literalToSql` as a
`Double`; because `1e20 == Math.floor(1e20)`, its integral fast path casts it
to `long`. Java specifies that an out-of-range [narrowing
conversion](https://docs.oracle.com/javase/specs/jls/se22/html/jls-5.html)
saturates, so the pushed clause becomes `"COL" = 9223372036854775807`. Oracle
applies that wrong predicate before BE's residual can recheck it, silently
dropping the `1e20` row. This is distinct from the existing NaN/Infinity
thread. Please keep the finite value/type when rendering (Oracle distinguishes
[`F`/`D` binary
literals](https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/Literals.html)),
or reject pushdown when it cannot be represented faithfully; add coverage
above `Long.MAX_VALUE` and at the binary exponent endpoints.
##########
fe/fe-connector/fe-connector-jdbc/src/main/java/org/apache/doris/connector/jdbc/client/JdbcOracleConnectorClient.java:
##########
@@ -177,6 +177,9 @@ public ConnectorType jdbcTypeToConnectorType(JdbcFieldInfo
fieldInfo) {
}
return createDecimalOrString(scale, scale);
}
+ case "BINARY_FLOAT":
Review Comment:
[P1] Keep binary division-by-zero predicates local
Supporting these native binary types makes `nvl(d / CAST('0' AS DOUBLE),
CAST('-1' AS DOUBLE)) < 0` eligible for Oracle pushdown. Doris's
`DivideFloatingImpl` returns NULL for a zero divisor, so `nvl` yields `-1` and
the row qualifies. Oracle instead performs native
`BINARY_DOUBLE`/`BINARY_FLOAT` division and [returns positive
infinity](https://docs.oracle.com/en/database/oracle/oracle-database/19/adfns/sql-data-types.html);
its `nvl` does not take the fallback, the comparison is false, and the remote
WHERE discards the row before the retained BE conjunct can recover it. Oracle's
[`NVL` numeric
precedence](https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/NVL.html)
keeps the expression in the native binary type. This is distinct from the
existing bare NaN/Infinity-literal thread. Please render an equivalent
zero-to-NULL guard or decline pushdown for binary floating division, and add an
Oracle regression covering the outer-`nvl` 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]