shivsood edited a comment on issue #25344: [SPARK-28151][SQL] Mapped ByteType 
to TinyINT for MsSQLServerDialect
URL: https://github.com/apache/spark/pull/25344#issuecomment-547690401
 
 
   > That should be like this? 
https://github.com/apache/spark/pull/25344/files#diff-391379a5ec51082e2ae1209db15c02b3R549
   > 
   > ```
   >     case ShortType =>
   >       (stmt: PreparedStatement, row: Row, pos: Int) =>
   >         stmt.setInt(pos + 1, row.getShort(pos))
   > ```
   > 
   > =>
   > 
   > ```
   >     case ShortType =>
   >       (stmt: PreparedStatement, row: Row, pos: Int) =>
   >         stmt.setShort(pos + 1, row.getShort(pos))
   > ```
   > 
   > ?
   @maropu Thanks for pointing out. From the code this looks like a problem. I 
dont know how to repro a failure here. Will send out a separate PR for this in 
some time. Do you suspect that this code should lead some corruption that's 
hard to repro. IMO that a short(2 bytes) will get allocated here, but this code 
will end up writing as a integer.
   
   @maropu Created JIRA https://issues.apache.org/jira/browse/SPARK-29644 for 
this issue. Will send a PR with the resolution and test.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to