We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51aa135 commit 1e5b801Copy full SHA for 1e5b801
python/pyspark/sql.py
@@ -674,10 +674,15 @@ def _restore_object(dataType, obj):
674
# use id(dataType) as key to speed up lookup in dict
675
# Because of batched pickling, dataType will be the
676
# same object in mose cases.
677
- cls = _cached_cls.get(id(dataType))
+ k = id(dataType)
678
+ cls = _cached_cls.get(k)
679
if cls is None:
- cls = _create_cls(dataType)
680
- _cached_cls[id(dataType)] = cls
+ # use dataType as key to avoid create multiple class
681
+ cls = _cached_cls.get(dataType)
682
+ if cls is None:
683
+ cls = _create_cls(dataType)
684
+ _cached_cls[dataType] = cls
685
+ _cached_cls[k] = cls
686
return cls(obj)
687
688
0 commit comments