Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-17916

CSV data source treats empty string as null no matter what nullValue option is

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.4.0
    • SQL
    • None

    Description

      When user configures nullValue in CSV data source, in addition to those values, all empty string values are also converted to null.

      data:
      col1,col2
      1,"-"
      2,""
      
      spark.read.format("csv").option("nullValue", "-")
      

      We will find a null in both rows.

      Attachments

        Activity

          People

            maxgekk Max Gekk
            falaki Hossein Falaki
            Votes:
            1 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: