saikocat removed a comment on pull request #30902:
URL: https://github.com/apache/spark/pull/30902#issuecomment-752115161


   Yup. Only till millis based on the constructor
   
https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/Time.html#<init>(long)
   . But database like MySQL can store up till microseconds.
   
   On Tue, 29 Dec 2020, 10:28 pm Wenchen Fan, <[email protected]> wrote:
   
   > *@cloud-fan* commented on this pull request.
   > ------------------------------
   >
   > In
   > 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
   > <https://github.com/apache/spark/pull/30902#discussion_r549724512>:
   >
   > > @@ -408,6 +421,23 @@ object JdbcUtils extends Logging {
   >        (rs: ResultSet, row: InternalRow, pos: Int) =>
   >          row.setFloat(pos, rs.getFloat(pos + 1))
   >
   > +
   > +    // SPARK-33888 - sql TIME type represents as physical int in millis
   > +    // Represents a time of day, with no reference to a particular 
calendar,
   > +    // time zone or date, with a precision of one millisecond.
   > +    // It stores the number of milliseconds after midnight, 00:00:00.000.
   > +    case IntegerType if metadata.contains("logicaltimetype") =>
   > +      (rs: ResultSet, row: InternalRow, pos: Int) => {
   > +        val rawTime = rs.getTime(pos + 1)
   > +        if (rawTime != null) {
   > +          val rawTimeInSeconds = rawTime.toLocalTime().toSecondOfDay()
   >
   > so the JDBC TIME only has second precision?
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/spark/pull/30902#pullrequestreview-559556378>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AA62IDKK7C5SREGWBT3L3ULSXHRRVANCNFSM4VGUOSUQ>
   > .
   >
   


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



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

Reply via email to