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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcOracleClient.java:
##########
@@ -217,6 +217,9 @@ protected Type jdbcTypeToDoris(JdbcFieldSchema fieldSchema) 
{
                     precision = scale;
                 }
                 return createDecimalOrStringType(precision, scale);
+            case "BINARY_FLOAT":

Review Comment:
   [P1] Update the Oracle connector mapper used by JDBC catalogs
   
   A normal `type='jdbc'` catalog is routed through `JdbcConnectorProvider` to 
`JdbcOracleConnectorClient`, and `JdbcConnectorMetadata#getTableSchema` calls 
that class's `jdbcTypeToConnectorType`. Its switch still has only `FLOAT` and 
falls through to `UNSUPPORTED` for both `BINARY_FLOAT` and `BINARY_DOUBLE`; 
this legacy `JdbcOracleClient` mapper is not on the catalog path (its remaining 
production callers are streaming helpers whose source enum excludes Oracle). 
Consequently this unit test can pass while `DESC`/queries on an Oracle catalog 
still reject these columns. Please add the two mappings to 
`JdbcOracleConnectorClient` and cover that production mapper, ideally with the 
existing Oracle JDBC regression suite.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcOracleClient.java:
##########
@@ -217,6 +217,9 @@ protected Type jdbcTypeToDoris(JdbcFieldSchema fieldSchema) 
{
                     precision = scale;
                 }
                 return createDecimalOrStringType(precision, scale);
+            case "BINARY_FLOAT":
+                return Type.FLOAT;

Review Comment:
   [P1] Do not push bare NaN/Infinity tokens to Oracle
   
   After the production mapping is fixed, these types make non-finite 
predicates reachable. The connector currently unwraps `CAST`, carries the Java 
`Double` into `JdbcQueryBuilder`, and `literalToSql` renders it with 
`toString()`, so for example `binary_double_col < CAST('Infinity' AS DOUBLE)` 
becomes `"BD" < Infinity`. Oracle accepts the supplied 
`BINARY_FLOAT_NAN`/`BINARY_DOUBLE_NAN` and 
`BINARY_FLOAT_INFINITY`/`BINARY_DOUBLE_INFINITY` constants, not bare 
`NaN`/`Infinity` tokens ([Oracle 
literals](https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/Literals.html)).
 Please render the type-appropriate Oracle literal (including negative 
infinity) or decline this conjunct from pushdown so BE evaluates it locally, 
and add query-builder/regression coverage.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcOracleClient.java:
##########
@@ -217,6 +217,9 @@ protected Type jdbcTypeToDoris(JdbcFieldSchema fieldSchema) 
{
                     precision = scale;
                 }
                 return createDecimalOrStringType(precision, scale);
+            case "BINARY_FLOAT":
+                return Type.FLOAT;
+            case "BINARY_DOUBLE":

Review Comment:
   [P1] Preserve the binary format on Oracle JDBC writes
   
   Once these cases are added to the production connector mapper, the columns 
also become writable through the JDBC catalog. The sink currently binds every 
Doris `FLOAT`/`DOUBLE` with standard `PreparedStatement.setFloat`/`setDouble`, 
and its writer parameters carry neither the remote Oracle type nor even 
`table_type`. Oracle documents that these standard setters send NUMBER-format 
bits by default; converting those bits back into `BINARY_FLOAT`/`BINARY_DOUBLE` 
is not bit-exact and can corrupt values 
([OraclePreparedStatement](https://docs.oracle.com/en/database/oracle/oracle-database/26/jajdb/oracle/jdbc/OraclePreparedStatement.html)).
 Please preserve enough Oracle/type information to use native binary setters, 
or enable `SetFloatAndDoubleUseBinary` for Oracle writer connections, and cover 
a binary-float INSERT/readback round trip.



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