You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ZhouDaHong (Jira)" <ji...@apache.org> on 2020/08/14 03:55:00 UTC

[jira] [Comment Edited] (SPARK-32587) SPARK SQL writing to JDBC target with bit datatype using Dataframe is writing NULL values

    [ https://issues.apache.org/jira/browse/SPARK-32587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17177465#comment-17177465 ] 

ZhouDaHong edited comment on SPARK-32587 at 8/14/20, 3:54 AM:
--------------------------------------------------------------

Sorry, I don't really understand your problem.

Do you mean that data cannot be written to the SQL Server database when there is a null value column?

If this is the case, please check the structure of the table to see if the error reporting field is defined as "not null" in the database?


was (Author: zdh):
Sorry, I don't really understand your problem. Do you mean that data cannot be written to the SQL Server database when there is a null value column? If this is the case, please check the structure of the table to see if the error reporting field is defined as "not null" in the database?

> SPARK SQL writing to JDBC target with bit datatype using Dataframe is writing NULL values
> -----------------------------------------------------------------------------------------
>
>                 Key: SPARK-32587
>                 URL: https://issues.apache.org/jira/browse/SPARK-32587
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 2.4.5
>            Reporter: Mohit Dave
>            Priority: Major
>
> While writing to a target in SQL Server using Microsoft's SQL Server driver using dataframe.write API the target is storing NULL values for BIT columns.
>  
> Table definition
> Azure SQL DB 
> 1)Create 2 tables with column type as bit
> 2)Insert some record into 1 table
> Create a SPARK job 
> 1)Create a Dataframe using spark.read with the following query
> select <bit_column> from <source_table>
> 2)Write the dataframe to a target table with bit type  as column.
>  
> Observation : Bit type is getting converted to NULL at the target
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org