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

PySpark silently accepts null values in non-nullable DataFrame fields.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • 2.0.0
    • PySpark, SQL
    • None

    Description

      Running the following code with a null value in a non-nullable column silently works. This makes the code incredibly hard to trust.

      In [2]: from pyspark.sql.types import *
      In [3]: sqlContext.createDataFrame([(None,)], StructType([StructField("a", TimestampType(), False)])).collect()
      Out[3]: [Row(a=None)]
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            cloud_fan Wenchen Fan
            kevincox Kevin Cox
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment