-
Notifications
You must be signed in to change notification settings - Fork 11
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
Materialized view #76
Conversation
0e67c5b
to
b4eea0d
Compare
b4eea0d
to
3a3ffa4
Compare
Please rebase on current version of #72 |
f49ab2b
to
b60383d
Compare
Please rebase on current master - it's a bit difficult to review with those unrelated changes from #72 |
b60383d
to
6747787
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 don't like that all the metadata methods are in session.rs - they should have their own file, as they are not methods on the CassSesson object.
6747787
to
884bb59
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 don't quite like how are the structs / functions places between session.rs
and metadata.rs
. Before this PR we had no metadata.rs
file, so everything was put into session.rs.
Now that we have it, we can fix this situation.
I'd propose the following:
- Leave
query_results.rs
as it is - meaning that functions accepting or returningCassIterator
go there. - Move metadata structs to
metadata.rs
-CassKeyspaceMeta_
,CassKeyspaceMeta
,CassTableMeta_
,CassTableMeta
,CassMaterializedViewMeta_
,CassMaterializedViewMeta
,CassColumnMeta
,CassSchemaMeta_
,CassSchemaMeta
. - Move metadata functions that don't touch session into
metadata.rs
- everything fromcass_schema_meta_free
downward. create_table_metadata
should probably also go intometadata.rs
, but I'm not 100% sure about it.
What do you think?
8d1201e
to
7a424cc
Compare
As you suggested above, I moved all metadata-related structures and functions to |
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 like the overall changes now (apart from few comments I left).
Few issues I have with the commits:
- "Add materialized view metadata ": message is incorrect, there is not RefCell anymore
- "Add impl for functions returning view metadata fields " - this commit should not include moving existing functions between files, that should be a seperate one.
01b5ae7
to
a4274ac
Compare
a4274ac
to
303807e
Compare
2306d4b
to
c5db322
Compare
Added `CassMaterializedViewMeta` struct to store metadata for views. As the interface should enable to get base table metadata for each view, as well as to get all views for a given table metadata, to avoid memory leaks because of the cyclic references, `base_table` of `CassMaterializedViewMeta` is a `Weak` reference to `CassTableMeta`.
Moved metadata-related structs and functions from `session.rs` to `metadata.rs` to have only session-related functions in `session.rs`.
Added implementation for the following functions: * cass_keyspace_meta_materialized_view_by_name * cass_keyspace_meta_materialized_view_by_name_n * cass_table_meta_materialized_view_by_name * cass_table_meta_materialized_view_by_name_n * cass_table_meta_materialized_view_count * cass_table_meta_materialized_view * cass_materialized_view_meta_column_by_name * cass_materialized_view_meta_column_by_name_n * cass_materialized_view_meta_name * cass_materialized_view_meta_base_table * cass_materialized_view_meta_column_count * cass_materialized_view_meta_column * cass_materialized_view_meta_partition_key_count * cass_materialized_view_meta_partition_key * cass_materialized_view_meta_clustering_key_count * cass_materialized_view_meta_clustering_key
Added CassViewMetaIterator struct to enable iteration over materialized view metadata for keyspace and table metadata, as well as iteration over view metadata fields such as columns. Enabled materialized view metadata tests on GitHub Actions.
c5db322
to
8d3bc8e
Compare
Actually, one more changed is needed - adjustment of the limitations table in README to take into account changes made by this PR |
@Lorak-mmk Guess it is good now to be merged. |
Also, as you mentioned earlier, a nice optimization maybe not copy the metadata information, but have a pointer to a |
Pre-review checklist
.github/workflows/build.yaml
ingtest_filter
.This PR is dependent upon #72
Adds support to fetch materialized views from cluster metadata and implementation for functions to return fields of a certain view in the metadata. Additionally, it adds support to iterate over materialized views.