You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Takeshi Yamamuro (Jira)" <ji...@apache.org> on 2019/12/29 09:14:00 UTC

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

    [ https://issues.apache.org/jira/browse/SPARK-29584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17004721#comment-17004721 ] 

Takeshi Yamamuro commented on SPARK-29584:
------------------------------------------

This issue is related to integrity constraints that are related to SPARK-19842.

> 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
>            Priority: Major
>
> 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