zhan7236 opened a new pull request, #37181:
URL: https://github.com/apache/shardingsphere/pull/37181

   ## Changes
   This PR fixes the "Order by value must implement Comparable" error when 
executing ORDER BY operations on Oracle TIMESTAMP WITH TIME ZONE type columns.
   
   ### Root Cause
   Oracle JDBC driver uses non-standard type codes:
   - `-101` for `TIMESTAMP WITH TIME ZONE`
   - `-102` for `TIMESTAMP WITH LOCAL TIME ZONE`
   
   The `ResultSetMapper.load()` method's `default` branch was calling 
`resultSet.getObject()`, which returns Oracle-specific objects that don't 
implement `Comparable`.
   
   ### Solution
   1. Added `getTimestampValue()` default method to `DialectResultSetMapper` 
interface
   2. Created `OracleResultSetMapper` to handle Oracle-specific type codes by 
calling `resultSet.getTimestamp()` which returns `java.sql.Timestamp` 
(implements `Comparable`)
   3. Updated `ResultSetMapper.load()` to delegate to dialect mappers in the 
`default` branch
   
   ### Changes
   | File | Type | Description |
   |------|------|-------------|
   | `DialectResultSetMapper.java` | Modified | Added `getTimestampValue()` 
default method |
   | `ResultSetMapper.java` | Modified | Delegate to dialect mapper in default 
branch |
   | `OracleResultSetMapper.java` | New | Handle Oracle timestamp type codes |
   | `DialectResultSetMapper` SPI | New | Register Oracle mapper |
   | `OracleResultSetMapperTest.java` | New | Unit tests |
   
   ### Testing
   - All existing tests pass
   - Added 5 new test cases for `OracleResultSetMapper`
   
   Fixes #33678


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

Reply via email to