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

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.4.0
    • Component/s: SQL
    • Labels:
      None
    • Target Version/s:

      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

            • Assignee:
              maxgekk Maxim Gekk
              Reporter:
              falaki Hossein Falaki
            • Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: