You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ABHISHEK KUMAR GUPTA (Jira)" <ji...@apache.org> on 2019/10/24 04:35:00 UTC

[jira] [Created] (SPARK-29584) NOT NULL is not supported in Spark

ABHISHEK KUMAR GUPTA created SPARK-29584:
--------------------------------------------

             Summary: NOT NULL is not supported in Spark
                 Key: SPARK-29584
                 URL: https://issues.apache.org/jira/browse/SPARK-29584
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: ABHISHEK KUMAR GUPTA


Spark while creating table restricting column for NULL value is not supported.

As below

PostgreSQL: SUCCESS No Exception


 CREATE TABLE Persons (ID int *NOT NULL*, LastName varchar(255) *NOT NULL*,FirstName varchar(255) NOT NULL, Age int);
 insert into Persons values(1,'GUPTA','Abhi',NULL);
 select * from persons;

 

Spark: Parse Exception

jdbc:hive2://10.18.19.208:23040/default> CREATE TABLE Persons (ID int NOT NULL, LastName varchar(255) NOT NULL,FirstName varchar(255) NOT NULL, Age int);
Error: org.apache.spark.sql.catalyst.parser.ParseException:
no viable alternative at input 'CREATE TABLE Persons (ID int NOT'(line 1, pos 29)

 Parse Exception



--
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