You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Min Zhao (Jira)" <ji...@apache.org> on 2023/08/02 06:02:00 UTC
[jira] [Updated] (SPARK-44627) org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils#resultSetToRows produces wrong data
[ https://issues.apache.org/jira/browse/SPARK-44627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Min Zhao updated SPARK-44627:
-----------------------------
Attachment: image-2023-08-02-14-01-54-447.png
> org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils#resultSetToRows produces wrong data
> ---------------------------------------------------------------------------------------------
>
> Key: SPARK-44627
> URL: https://issues.apache.org/jira/browse/SPARK-44627
> Project: Spark
> Issue Type: Bug
> Components: Spark Core
> Affects Versions: 2.3.2, 3.3.1
> Reporter: Min Zhao
> Priority: Major
> Attachments: image-2023-08-02-14-01-54-447.png
>
>
> When the resultSet exists a timestmp column and it's value is null, In the row it generates, this column will use the value of the same column in the previous row.
>
> In mysql, if a datetime column is defined, meanwhile it is not null. When a value is '0000-00-00 00:00:00', mysql provided a property of zeroDateTimeBehavior, it will return null.
> table define:
> CREATE TABLE `test_timestamp` (
> `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
> `unbind_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ,
> PRIMARY KEY (`id`)
> )
> example:
> the value of resultSet
> 1, 2023-01-01 12:00:00
> 2, null
>
> the value of row
> 1, 2023-01-01 12:00:00
> 2, 2023-01-01 12:00:00
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org