You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2023/01/06 02:47:00 UTC

[jira] [Resolved] (SPARK-41861) Make v2 ScanBuilders' build() return typed scan

     [ https://issues.apache.org/jira/browse/SPARK-41861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wenchen Fan resolved SPARK-41861.
---------------------------------
    Fix Version/s: 3.4.0
       Resolution: Fixed

Issue resolved by pull request 39367
[https://github.com/apache/spark/pull/39367]

> Make v2 ScanBuilders' build() return typed scan
> -----------------------------------------------
>
>                 Key: SPARK-41861
>                 URL: https://issues.apache.org/jira/browse/SPARK-41861
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 3.3.1
>            Reporter: Lorenzo Martini
>            Assignee: Lorenzo Martini
>            Priority: Trivial
>             Fix For: 3.4.0
>
>
> The `ScanBuilder` interface has the `build()` method to return `Scan` objects. All the different implementations of it return scans that are of the type of the builder itself. Eg `ParquetScanBuilder` will return a `ParquetScan`, `TextScanBuilder` a `TextScan` etc. However, in the method overrides declaration, the return type is not changed to the more specific type but left as a generic `Scan`. This is a bit problematic when one has to work with scan object because a manual cast is required, even if we know for a fact that a `ParquetScanBuilder`'s `build()` method will return a `ParquetScan`. For ease of developement (and for stricter correctness checks, as we wouldn't want a `ParquetScanBuilder` to return a non-parquet scan I would assume), it would be very nice if the `build()` methods of each implementation of `ScanBuilder`s returned a more strictly typed object instead of the generic `Scan` object



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org