xinrong-databricks commented on code in PR #36640:
URL: https://github.com/apache/spark/pull/36640#discussion_r880035876
##########
python/pyspark/sql/session.py:
##########
@@ -611,7 +611,7 @@ def _inferSchema(
:class:`pyspark.sql.types.StructType`
"""
first = rdd.first()
- if not first:
+ if first != 0 and not first:
Review Comment:
Even if we let it pass this if-else check, PySpark returns an empty
DataFrame as below
```py
>>> spark.createDataFrame(spark._sc.parallelize([[],[]])).show()
++
||
++
||
||
++
```
whereas Spark SQL returns a DataFrame where each row is an empty array.
Let me check the code paths further and adjust that. Thanks!
--
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]