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

Explicitly specify buildScan return type #826

Merged
merged 1 commit into from Aug 22, 2016

Conversation

pfcoperez
Copy link
Contributor

@pfcoperez pfcoperez commented Aug 19, 2016

Because of type inference, not explicitly providing providing a return type for:

def buildScan(requiredColumns: Array[String], filters: Array[Filter])

... gives it the return type ScalaEsRowRDD which is a compatible type with the overridden method but limits further overriding on which some transformation is performed by the means of Spark. e.g:

org.evilcorpt.spark.sql

class SomeNewClass(...) extends ElasticsearchRelation(...) {
...
    def buildScan(requiredColumns: Array[String], filters: Array[Filter]): RDD[Row] =
        super.buildScan(requiredColumns, filters).map(someTransformationFunction)
...
}

@jbaiera
Copy link
Member

jbaiera commented Aug 22, 2016

Everything looks good to me. Thanks for the PR!

@jbaiera jbaiera merged commit 27c3b8d into elastic:master Aug 22, 2016
@pfcoperez
Copy link
Contributor Author

@jbaiera Thanks to you for merging it 😄

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

Successfully merging this pull request may close these issues.

None yet

2 participants