-
Notifications
You must be signed in to change notification settings - Fork 109
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
Explicit table naming in examples to prevent errors from shared tables across examples #846
Explicit table naming in examples to prevent errors from shared tables across examples #846
Conversation
This is going to be a problem again when someone adds new example with conflicting schema - even running examples in CI is not guaranteed to catch that. |
7af1184
to
30acf5d
Compare
Makes sense to me. Updated PR to match the suggestion. All examples except |
Code changes look fine to me. Please update PR description (because it no longer changes just |
30acf5d
to
c021936
Compare
Done! #847 might block CI checks. |
Yep, could you rebase on main, as #847 is fixed now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me now, I think we can merge after rebasing on main.
c021936
to
c8abb78
Compare
Done! |
ks is changed from ks to examples_ks table names are changed from t to the example file name Examples share an explicitly named keyspace Examples now have unique table names preventing errors that occur from two examples sharing the same table
c8abb78
to
86e42f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased the pull request - there were conflicts in cql-time-types.rs
which I had to resolve. Let's wait for the CI to complete.
LGTM from my side - @Lorak-mmk, please review and merge at your convenience.
The following examples use/reuse the following table name and schema:
"CREATE TABLE IF NOT EXISTS ks.t (a int, b int, c text, primary key (a, b))",
basic
execution_profile
query_history
schema-agreement
select-paging
speculative-execution
tls
The following examples currently use/reuse the
ks.t
table, with a different schema:custom_deserializion
uses"CREATE TABLE IF NOT EXISTS ks.t (pk int primary key, v text)"
compare-tokens
uses"CREATE TABLE IF NOT EXISTS ks.compare_tokens_example (pk bigint primary key)"
Depending on what order the examples are run/rerun locally, the examples can create inconsistent table schemas for
ks.t
that cause errors in the examples.This PR changes the keyspace name in all examples to
examples_ks
and uses the example file name as the table name for all example tables. This should address any errors caused by tables that are shared between examples.Fixes: #844
Pre-review checklist
./docs/source/
.Fixes:
annotations to PR description.