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

fix(spanddl): support dropping interleaved tables #501

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

thall
Copy link
Member

@thall thall commented Jan 3, 2024

  • test(spanddl): possibility to specify expected error for ddl statement
  • feat: throw error if dropping table with interleaved tables
  • fix(spanddl): support dropping interleaved tables

@thall thall requested a review from odsod as a code owner January 3, 2024 15:49
@thall thall requested a review from a team January 3, 2024 15:49
@thall thall changed the title fix drop interleaved fix(spanddl): support dropping interleaved table Jan 3, 2024
`DROP TABLE Albums`,
},
errorDdlIndex: 1,
errorContains: "DROP TABLE: table Albums does not exist",
Copy link
Member Author

Choose a reason for hiding this comment

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

errorContains was unused before this pr.

assert.ErrorContains(t, err, tt.errorContains)
break
return
Copy link
Member Author

Choose a reason for hiding this comment

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

exit early if any ddl statement thrown an error

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2024

Codecov Report

Attention: 309 lines in your changes are missing coverage. Please review.

Comparison is base (762bfd8) 44.66% compared to head (33c5c38) 43.45%.
Report is 196 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
- Coverage   44.66%   43.45%   -1.22%     
==========================================
  Files          21       20       -1     
  Lines        4267     4582     +315     
==========================================
+ Hits         1906     1991      +85     
- Misses       2249     2483     +234     
+ Partials      112      108       -4     
Files Coverage Δ
internal/codegen/databasecodegen/common.go 100.00% <100.00%> (ø)
...nternal/codegen/databasecodegen/readtransaction.go 100.00% <100.00%> (ø)
spanddl/database.go 72.41% <100.00%> (+21.62%) ⬆️
spanddl/table.go 29.46% <0.00%> (ø)
internal/examples/freightdb/descriptor_gen.go 0.00% <0.00%> (ø)
internal/examples/musicdb/descriptor_gen.go 5.55% <0.00%> (-1.47%) ⬇️
internal/examples/freightdb/database_gen.go 23.28% <41.37%> (+0.07%) ⬆️
internal/examples/musicdb/database_gen.go 17.20% <6.29%> (-3.57%) ⬇️

Before the parent would have an reference to the dropped table, which
caused an type error since the type could not be resolved.

This PR removes the child reference in the parent table.
@thall thall force-pushed the fix-drop-interleaved branch from 27e15aa to 33c5c38 Compare January 4, 2024 06:59
@thall thall changed the title fix(spanddl): support dropping interleaved table fix(spanddl): support dropping interleaved tables Jan 4, 2024
Copy link

@oscarmuhr oscarmuhr left a comment

Choose a reason for hiding this comment

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

LGTM! 🌟

@thall thall merged commit 54c6334 into master Jan 8, 2024
1 check passed
@thall thall deleted the fix-drop-interleaved branch January 8, 2024 09:58
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.

3 participants