zhengruifeng opened a new pull request, #42736:
URL: https://github.com/apache/spark/pull/42736

   ### What changes were proposed in this pull request?
   Add `CalendarIntervalType` to PySpark
   
   
   ### Why are the changes needed?
   in scala:
   ```
   scala> spark.sql("SELECT make_interval(100, 11, 1, 1, 12, 30, 
01.001001)").schema
   res2: org.apache.spark.sql.types.StructType = 
StructType(StructField(make_interval(100, 11, 1, 1, 12, 30, 
1.001001),CalendarIntervalType,true))
   ```
   
   in python:
   ```
   In [1]: spark.sql("SELECT make_interval(100, 11, 1, 1, 12, 30, 
01.001001)").schema
   
   ...
   
   AssertionError: Undefined error message parameter for error class: 
CANNOT_PARSE_DATATYPE. Parameters: {'error': "Undefined error message parameter 
for error class: CANNOT_PARSE_DATATYPE. Parameters: {'error': 'interval'}"}
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   yes
   
   after this PR:
   ```
   In [1]: spark.sql("SELECT make_interval(100, 11, 1, 1, 12, 30, 
01.001001)").schema
   Out[1]: StructType([StructField('make_interval(100, 11, 1, 1, 12, 30, 
1.001001)', CalendarIntervalType(), True)])
   
   ```
   
   
   ### How was this patch tested?
   added UT
   
   ### Was this patch authored or co-authored using generative AI tooling?
   NO


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to