Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.0.0
    • None
    • SQL
    • None

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              abhishek.akg ABHISHEK KUMAR GUPTA
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: