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

CREATE EXTERNAL TABLE without OPTIONS #248

Merged
merged 15 commits into from
Dec 18, 2023

Conversation

osopardo1
Copy link
Member

@osopardo1 osopardo1 commented Dec 5, 2023

Description

Fixes #246

Type of change

Allows the creation of an already physically formatted Qbeast Table without the need to specify the options columnsToIndex or cubeSize. In case the table is external, exists, and has Qbeast Metadata, it loads the required parameters from the QbeastSnapshot.

Let's see an example:

val df = Seq(1, 2, 3).toDF("id")
df.write.format("qbeast").option("columnsToIndex", "id").save("/tmp/qbeast_table")

spark.sql("CREATE EXTERNAL TABLE t USING qbeast LOCATION '/tmp/qbeast_table'")

Checklist:

Here is the list of things you should do before submitting this pull request:

  • New feature / bug fix has been committed following the Contribution guide.
  • Add comments to the code (make it easier for the community!).
  • Change the documentation.
  • Add tests.
  • Your branch is updated to the main branch (dependent changes have been merged).

How Has This Been Tested? (Optional)

It is tested in QbeastSQLIntegrationTest.

Copy link

codecov bot commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (18b4534) 91.76% compared to head (61a7468) 91.78%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #248      +/-   ##
==========================================
+ Coverage   91.76%   91.78%   +0.02%     
==========================================
  Files          91       91              
  Lines        2258     2264       +6     
  Branches      167      172       +5     
==========================================
+ Hits         2072     2078       +6     
  Misses        186      186              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@osopardo1 osopardo1 requested a review from Jiaweihu08 December 7, 2023 07:37
@osopardo1
Copy link
Member Author

Adding some tests I've found a weird behavior when passing Options/Paramaters/Properties back and forth.

For example, if a Table already exists with Options A and B, the user can:

  • Not specify options, and A and B should be considered.
  • Specify options, and A and B should be verified and overriden if necessary.

In the second case, options A and B weren't passed to the save methods, and subsequently not overridden.

Fixing them!!

@osopardo1 osopardo1 merged commit 468c86d into Qbeast-io:main Dec 18, 2023
3 checks passed
fpj pushed a commit that referenced this pull request Mar 27, 2024
Main added features:
- Rollup
- Domain-driven appends
- Auto-indexing
- Multi-block file

Additionally, this merge performs the following:
- Updates documentation according to the new version.
- Removes unnecessary classes (e.g., CubeInfo).
- Resolves inconsistencies with the Auto Indexing #247 and CREATE EXTERNAL TABLE without OPTIONS #248 changes.
- compact() is no longer necessary, but we are leaving it to avoid additional changes to the staging area. We have issue 294 open to resolve it later.

---------

Co-authored-by: Alexey Akimov
Co-authored-by: Jiawei
Co-authored-by: osopardo1
Co-authored-by: osopardo1
Co-authored-by: SrTangente
Co-authored-by: SrTangente
Co-authored-by: jiawei
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

Successfully merging this pull request may close these issues.

CREATE EXTERNAL TABLE with LOCATION should load existing configuration
2 participants