uros-b commented on code in PR #57564:
URL: https://github.com/apache/spark/pull/57564#discussion_r3657792626


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -525,6 +535,16 @@ abstract class JdbcDialect extends Serializable with 
Logging {
     }
   }
 
+  /**
+   * Truncates `expr` toward zero, so that a cast from a fractional type to an 
integral type that
+   * is pushed down matches Spark, which truncates rather than rounds. 
Dialects for databases that
+   * round such casts override this with the database's truncating function. 
The default returns
+   * `expr` unchanged, for databases whose cast already truncates like Spark.
+   * @param expr The SQL string of the value being cast.
+   * @return The SQL string to cast instead of `expr`.
+   */
+  def truncateFractionalValue(expr: String): String = expr

Review Comment:
   I would advise to avoid breaking change. In any case, please add the 
`@Since` annotation here (like every sibling public method has one).



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