Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spark DataSource support #99

Open
rabejens opened this issue Nov 25, 2018 · 0 comments
Open

Spark DataSource support #99

rabejens opened this issue Nov 25, 2018 · 0 comments

Comments

@rabejens
Copy link

Not so long ago I discovered a nifty Spark feature: Spark's Data Source. You can read this article on Hackernoon about it.

Basically, you create a class called DefaultSource which mixes in RelationProvider and SchemaRelationProvider whose createRelation methods return an object of type BaseRelation with TableScan. This allows you to specify a Spark Schema and a method that returns an RDD[Row] based on the schema, which is automagically converted to a DataFrame when you do something like:

val df = spark.
  read.
  format("com.example.foo.bar").
  load("hdfs://path/to/my/data")

where the DefaultSource class resides in the package com.example.foo.bar.

With this, I hooked up all our reading logic for our special data formats (binary or text-based measuring data that is not always readable with the default CSV data source).

It would be really nice to have a Data source in Seahorse where you can specify the package of the DefaultSource class and the URL of the data as usual and where the data is then pulled in via this mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant