GitHub user liancheng opened a pull request:
https://github.com/apache/spark/pull/11137
[SPARK-13244] [WIP] Prototyping DataFrame to Dataset migration
This PR prototypes the `DataFrame`-to-`Dataset` migration. It demonstrates
main migration strategies but hasn't migrate all `DataFrame` methods.
Compilation/tests may break.
Goals:
1. `Dataset` should have all operations of the original `DataFrame`
1. `DataFrame` is just a special `Dataset[Row]`
1. Source level compatibility whenever possible
Basic strategies used:
1. Migrate all methods in `DataFrame` into `Dataset`
1. Migrate all methods in `GroupedData` into `GroupedDataset[K, V]` and
then remove `GroupedData`
1. Make `DataFrame` extend from `Dataset[Row]`
Overrides untyped `Dataset` operations in `DataFrame` and make them
return `DataFrame` instead of `Dataset[Row]`
For all untyped methods (typically those take `String`s and `Column`s as
arguments), make them return `Row`, `Dataset[Row]`, or `GroupedDataset[Row, T]`.
Problems encountered:
1. `DataFrame` RDD operations conflict with `Dataset` functional operations
E.g.: `df.map` returns an RDD while `df.map` returns a `Dataset`.
Possible solutions:
- Remove `DataFrame` RDD operations since they can be easily mapped
to methods of `df.rdd.
Cons: breaks source level compatibility
- Rename those `Dataset` methods
Cons: may result inconsistent naming
Personally I prefer the former option.
2. `Dataset` methods returning arrays can't be overriden in `DataFrame`
E.g.: `Dataset.randomSplit` returns `Array[Dataset[T]]`. We can't have
an override version for `DataFrame` and make it return `Array[DataFrame]`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/liancheng/spark df-to-ds
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11137.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11137
----
commit dbc1a00635b737d3ca86ce08e3072b903620119a
Author: Cheng Lian <[email protected]>
Date: 2016-02-09T17:22:46Z
WIP: prototyping DataFrame to Dataset migration
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]