stefankandic commented on code in PR #46737:
URL: https://github.com/apache/spark/pull/46737#discussion_r1670161382


##########
python/pyspark/sql/types.py:
##########
@@ -747,8 +747,8 @@ def jsonValue(self) -> Dict[str, Any]:
     def fromJson(
         cls,
         json: Dict[str, Any],
-        fieldPath: str,
-        collationsMap: Optional[Dict[str, str]],
+        fieldPath: str = "",
+        collationsMap: Optional[Dict[str, str]] = None,
     ) -> "ArrayType":
         elementType = _parse_datatype_json_value(
             json["elementType"], fieldPath + ".element", collationsMap

Review Comment:
   Yes, if you are deserializing a schema where an array is on the column `a` 
the `collationsMap` would be `{"a.element": collation}`. So if you just want to 
deserialize a map that is not a part of the larger schema the `collationsMap` 
should be `{".element": collation}`
   
   Added tests to verify this.



-- 
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