allisonwang-db commented on code in PR #43784:
URL: https://github.com/apache/spark/pull/43784#discussion_r1393582670
##########
python/pyspark/sql/tests/test_python_datasource.py:
##########
@@ -118,25 +118,26 @@ def reader(self, schema) -> "DataSourceReader":
self.spark.dataSource.register(JsonDataSource)
path1 = os.path.join(SPARK_HOME, "python/test_support/sql/people.json")
- path2 = os.path.join(SPARK_HOME,
"python/test_support/sql/people1.json")
+ # path2 = os.path.join(SPARK_HOME,
"python/test_support/sql/people1.json")
df1 = self.spark.read.format("my-json").load(path1)
self.assertEqual(df1.rdd.getNumPartitions(), 1)
assertDataFrameEqual(
df1,
[Row(name="Michael", age=None), Row(name="Andy", age=30),
Row(name="Justin", age=19)],
)
- df2 = self.spark.read.format("my-json").load([path1, path2])
- self.assertEqual(df2.rdd.getNumPartitions(), 2)
- assertDataFrameEqual(
- df2,
- [
- Row(name="Michael", age=None),
- Row(name="Andy", age=30),
- Row(name="Justin", age=19),
- Row(name="Jonathan", age=None),
- ],
- )
+ # Multiple paths are now allowed in DSv1, see SPARK-45597
Review Comment:
Yea. I tried the DSv2 approach (serialize multiple paths into a JSON string
and store them in the `options["paths"]` field, but I found it confusing, as
users need to deserialize this JSON string. It behaves very differently from a
single path. I am going to disable it for now unless there are strong needs for
supporting multiple paths.
--
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]