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

#84: Added Exasol SQL statement builder #88

Merged
merged 4 commits into from Mar 4, 2021

Conversation

morazow
Copy link
Contributor

@morazow morazow commented Mar 2, 2021

Fixes #14
Fixes #39
Fixes #84

@morazow morazow requested review from 3cham and jakobbraun March 2, 2021 08:58
@morazow morazow changed the title #84: Added Exas SQL statement builder (ESB) #84: Added Exasol SQL statement builder Mar 2, 2021
@codecov
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

Merging #88 (582ebc0) into main (2abe84a) will increase coverage by 1.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   94.59%   95.76%   +1.17%     
==========================================
  Files          10       11       +1     
  Lines         407      425      +18     
  Branches       53       48       -5     
==========================================
+ Hits          385      407      +22     
+ Misses         22       18       -4     
Impacted Files Coverage Δ
...rc/main/scala/com/exasol/spark/DefaultSource.scala 100.00% <100.00%> (ø)
...n/scala/com/exasol/spark/ExasolQueryEnricher.scala 100.00% <100.00%> (ø)
...c/main/scala/com/exasol/spark/ExasolRelation.scala 94.11% <100.00%> (-1.34%) ⬇️
...rc/main/scala/com/exasol/spark/rdd/ExasolRDD.scala 86.44% <100.00%> (+3.68%) ⬆️
src/main/scala/com/exasol/spark/util/Filters.scala 100.00% <100.00%> (+5.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2abe84a...582ebc0. Read the comment docs.

src/it/scala/com/exasol/spark/BaseTableQueryIT.scala Outdated Show resolved Hide resolved
src/it/scala/com/exasol/spark/PredicatePushdownIT.scala Outdated Show resolved Hide resolved
src/it/scala/com/exasol/spark/PredicatePushdownIT.scala Outdated Show resolved Hide resolved
assert(result === Set((1, "Berlin")))
test("returns dataframe with greater than filter") {
val df = getDataFrame().filter($"id" > 2).collect()
assert(df.map(r => r.getString(1)) === Seq("Portugal"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you should also test that the predicate was really pushed down. (For example by checking the database logs)
(just an idea; not sure if required / makes sense)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is tested in enricher class.

This is before sending the query to the Exasol.

For example:

val df = spark.read
            .option("query", "SELECT * FROM people")
            .select("name", "surname")
            .filter($"id" > 10)

Should send the modified query to Exasol with column selection and where clauses:

SELECT "name", "surname" FROM people WHERE id > 10

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

src/main/scala/com/exasol/spark/util/Filters.scala Outdated Show resolved Hide resolved
src/main/scala/com/exasol/spark/util/Filters.scala Outdated Show resolved Hide resolved
src/main/scala/com/exasol/spark/util/Filters.scala Outdated Show resolved Hide resolved
morazow and others added 2 commits March 3, 2021 10:58
Co-authored-by: jakobbraun <jakob.braun@posteo.de>
@morazow morazow requested a review from jakobbraun March 3, 2021 12:17
@morazow morazow merged commit 256bc16 into main Mar 4, 2021
@morazow morazow deleted the refactoring/#84-add-sql-stmt-builder branch March 4, 2021 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants