sadhen commented on a change in pull request #32332:
URL: https://github.com/apache/spark/pull/32332#discussion_r622757279



##########
File path: python/pyspark/sql/session.py
##########
@@ -478,13 +478,22 @@ def _inferSchema(self, rdd, samplingRatio=None, 
names=None):
             schema = rdd.map(lambda row: _infer_schema(row, 
names)).reduce(_merge_type)
         return schema
 
-    def _createFromRDD(self, rdd, schema, samplingRatio):
+    def _create_verified_converter(self, schema, verifySchema):
+        converter = _create_converter(schema)
+        verify_func = _make_type_verifier(schema) if verifySchema else lambda 
_: True
+
+        def verify_and_convert(obj):
+            verify_func(obj)

Review comment:
       
https://github.com/apache/spark/blob/132cbf0c8c1a382f33d8d212f931f5956f85a2f9/python/pyspark/sql/session.py#L695
   
   It is not verified twice, previously, it is not verified. See the above 
`identity` prepare code snippet.




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

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