From dd75aa645f41620fdf15cf359ae42d7744882e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Bu=C5=9Bkiewicz?= Date: Mon, 20 Jul 2015 09:47:25 +0200 Subject: [PATCH] [SPARK-9101] [PySpark] Test for selecting null literal --- python/pyspark/sql/tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/pyspark/sql/tests.py b/python/pyspark/sql/tests.py index 241eac45cfe36..b17c79f6cfed3 100644 --- a/python/pyspark/sql/tests.py +++ b/python/pyspark/sql/tests.py @@ -333,6 +333,10 @@ def test_infer_nested_schema(self): df = self.sqlCtx.inferSchema(rdd) self.assertEquals(Row(field1=1, field2=u'row1'), df.first()) + def test_select_null_literal(self): + df = self.sqlCtx.sql("select null as col") + self.assertEquals(Row(col=None), df.first()) + def test_apply_schema(self): from datetime import date, datetime rdd = self.sc.parallelize([(127, -128, -32768, 32767, 2147483647, 1.0,