shahriyar-novruzov commented on PR #1378:
URL: https://github.com/apache/arrow-java/pull/1378#issuecomment-6290827359

   Thanks — renamed the class to `DecimalParameterCoercer`, it widens and 
scales rather than narrows.
   
   On the other two:
   
   **The cast on unsupported types.** `AvaticaParameterBinder` already catches 
`ClassCastException` from the converters and rethrows it with the context this 
suggests adding:
   
   ```
   Binding value of type DOUBLE is not yet supported for expected Arrow type 
Decimal(38, 3, 128)
   ```
   
   It names both the Avatica rep and the Arrow type. Throwing 
`IllegalArgumentException` here instead would escape that catch, so the caller 
would get a less specific error, not a better one. Returning a sentinel would 
mean every converter grows a second failure path for the same outcome. Left the 
cast so an unsupported rep keeps failing exactly as it does today.
   
   **`setValueCount` in the tests.** The converter tests in this package read 
back with `allocateNew(n)` + `getObject(i)` and no value count — the parameter 
path never sets one either, since the binder writes at an index and the 
statement sends the whole allocated batch. Matched the existing tests rather 
than introducing a different setup for one file.


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