zhengruifeng commented on PR #40276:
URL: https://github.com/apache/spark/pull/40276#issuecomment-1454583496

   I don't know the internal of Parser well, but I guess if we want to reach 
100% compatibility, we may need to reuse the `.g4` files and implement a subset 
of  `AstBuilder` to support `singleDataType` and `singleTableSchema`.
   
   For example, the DDL also support `NOT NULL` and `COMMENT`:
   ```
   >>> df = spark.createDataFrame([], """a string  COMMENT 'this is just a 
simple string' """)
   >>> df.schema
   StructType([StructField('a', StringType(), True)])
   >>> df = spark.createDataFrame([], """a string  NOT NULL COMMENT 'this is 
just a simple string' """)
   >>> df.schema
   StructType([StructField('a', StringType(), False)])
   ```
   
   cc @hvanhovell @cloud-fan @HyukjinKwon  WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to