You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2023/03/04 07:05:58 UTC

[GitHub] [spark] zhengruifeng commented on pull request #40276: [SPARK-42630][CONNECT][PYTHON] Implement data type string parser

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-unsubscribe@spark.apache.org

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


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