panbingkun commented on PR #45776:
URL: https://github.com/apache/spark/pull/45776#issuecomment-2033846860
> What concerns me is when you specify the schema:
>
> ```scala
> scala> spark.read.schema("value STRING").text().show()
> 24/04/03 15:35:10 WARN DataSource: All paths were ignored:
>
> +-----+
> |value|
> +-----+
> +-----+
>
>
> scala> spark.read.schema("value STRING").csv().show()
> 24/04/03 15:35:13 WARN DataSource: All paths were ignored:
>
> +-----+
> |value|
> +-----+
> +-----+
>
>
> scala> spark.read.schema("value STRING").json().show()
> 24/04/03 15:35:16 WARN DataSource: All paths were ignored:
>
> +-----+
> |value|
> +-----+
> +-----+
>
>
> scala> spark.read.schema("value STRING").orc().show()
> 24/04/03 15:35:19 WARN DataSource: All paths were ignored:
>
> +-----+
> |value|
> +-----+
> +-----+
>
>
> scala> spark.read.schema("value STRING").parquet().show()
> 24/04/03 15:35:21 WARN DataSource: All paths were ignored:
>
> +-----+
> |value|
> +-----+
> +-----+
> ```
>
> It all works with returning an empty DataFrame. Suppose that you have a
logic like:
>
> ```scala
> val paths: Seq[String] = ... // Get the paths from somewhere else
> spark.read.schema(...).csv(paths)
> ```
>
> then it will be broken.
@HyukjinKwon
Based on the new updates, the above has been restored to its `original
state`, as follows
```
Spark context Web UI available at http://172.24.144.22:4040
Spark context available as 'sc' (master = local-cluster[2, 1, 1024], app id
= app-20240403155813-0000).
Spark session available as 'spark'.
scala> spark.read.schema("value STRING").text().show()
+-----+
|value|
+-----+
+-----+
scala> spark.read.schema("value STRING").csv().show()
+-----+
|value|
+-----+
+-----+
scala> spark.read.schema("value STRING").json().show()
+-----+
|value|
+-----+
+-----+
scala> spark.read.schema("value STRING").orc().show()
+-----+
|value|
+-----+
+-----+
scala> spark.read.schema("value STRING").parquet().show()
+-----+
|value|
+-----+
+-----+
```
--
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]