Hyukjin Kwon created SPARK-61040:
------------------------------------

             Summary: Parse the DDL strings of DataType.fromDDL and of the 
return types of UDFs on the server in the Python client as PySpark does
                 Key: SPARK-61040
                 URL: https://issues.apache.org/jira/browse/SPARK-61040
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.3.0
            Reporter: Hyukjin Kwon


In PySpark Connect, {{DataType.fromDDL(ddl)}}, {{StructType.fromDDL}} and 
{{pyspark.sql.types._parse_datatype_string(s)}} parse a DDL string on the 
server of the active session ({{SparkSession._parse_ddl}}, the {{DDLParse}} of 
an {{AnalyzePlanRequest}}), as does a {{UserDefinedFunction}} of its DDL return 
type, as {{udf(f, "a INT NOT NULL")}}. So they take any DDL that Spark does, 
such as {{"a INT NOT NULL COMMENT 'c'"}}, {{"st struct<a:int,b:double>"}} and 
{{"s STRING COLLATE UTF8_LCASE"}}, and raise the errors of Spark's parser, such 
as {{PARSE_SYNTAX_ERROR}} for {{"a INT,"}}.

The Rust-backed Python client parses them on the client. It raises 
{{ValueError: [INVALID_DATATYPE_FORMAT]}} for {{NOT NULL}} and nested types, 
takes {{"s STRING COLLATE UTF8_LCASE"}} as a string of the collation {{collate 
utf8_lcase}}, and {{"a INT,"}} as {{a INT}}. It has no 
{{pyspark.sql.types._parse_datatype_string}}. Parse them as PySpark does.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to