-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support SQL statement INSERT INTO with Qbeast format #116
Conversation
Hey @Adricu8 , it seems like the description of the PR is not updated, could you explain more about the issue? Thanks! |
Yes of course, I updated the description. Let me know if there is anything unclear. |
…earTransformation
… be solved, removed replaceFileIndex
src/main/scala/io/qbeast/spark/internal/sources/QbeastDataSource.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/qbeast/spark/internal/sources/QbeastBaseRelation.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/qbeast/spark/internal/sources/QbeastBaseRelation.scala
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #116 +/- ##
==========================================
+ Coverage 90.64% 90.69% +0.05%
==========================================
Files 60 59 -1
Lines 1325 1344 +19
Branches 102 99 -3
==========================================
+ Hits 1201 1219 +18
- Misses 124 125 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. |
core/src/main/scala/io/qbeast/core/transform/LinearTransformation.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/io/qbeast/core/transform/LinearTransformationTest.scala
Show resolved
Hide resolved
src/main/scala/io/qbeast/spark/internal/QbeastSparkSessionExtension.scala
Outdated
Show resolved
Hide resolved
src/main/scala/io/qbeast/spark/internal/sources/QbeastDataSource.scala
Outdated
Show resolved
Hide resolved
Looks good to me! Just add simple documentation on the README and that's it! |
Description
Fixing this issue
We have removed the class QbeastBaseRelation. Now we only make use of its object to instantiate a BaseRelation (or HadoopFsRelation)
In this way, the function createRelation is implemented in object QbeastBaseRelation and the insertable relation is not lost.
Moreover, we do not need the ReplaceFileIndex extension and has also been removed. LogicalRelation now makes use of a HadoopFsRelation instead of QbeastBaseRelation.
Now we are able to use SQL statement INSERT INTO like:
spark.sql("insert into table t select * from t2")
We had to modify more code to make the following statement work aswell:
spark.sql("insert into table t (value) values (4)")
It would be nice to create a test with all the possible insert statements that spark can handle
https://spark.apache.org/docs/3.1.2/sql-ref-syntax-dml-insert-into.html
Furthermore, we might want to test that the implemented logic is correct.
When we use this syntax we get an error that the transformation is unknown. Instead of a Linear transformation the transformation type is: io.qbeast.core.transform.IdentityTransformation.
Type of change
Describe the change you're making: how it affects the API, user experience...
Checklist:
How Has This Been Tested? (Optional)
Please describe the tests that you ran to verify your changes.
Test Configuration: