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: serialize distinct cache in catalog #25990

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Conversation

hiltontj
Copy link
Contributor

@hiltontj hiltontj commented Feb 11, 2025

The distinct cache info for tables was not serialized in the catalog. This fixes that, but also updates the catalog serialization to use the same snapshot pattern for serialization from the Catalog type all the way down. This removes the need to serialize the db_map from the catalog.

The Eq and PartialEq derives were removed from Catalog and InnerCatalog as they were only used in tests, where assertions using them were replaced by insta snapshot tests.

A test was added to check serialization/deserialization of distinct caches in the catalog.

There is no issue for this.

@hiltontj hiltontj added the v3 label Feb 11, 2025
@hiltontj hiltontj self-assigned this Feb 11, 2025
The distinct cache info for tables was not serialized in the catalog.
This fixes it, but also updates the catalog serialization to use the
snapshot type serialization from the Catalog type all the way down.

The Eq and PartialEq impls were removed from Catalog and InnerCatalog
as they were only used in tests, and wer replaced by pure insta snapshot
tests.

A test was added to check that the distinct cache serializes/deserializes
@hiltontj hiltontj force-pushed the hiltontj/catalog-serde branch from b0d6d6d to fe53e4e Compare February 11, 2025 15:07
@hiltontj hiltontj requested a review from a team February 11, 2025 15:08
@hiltontj hiltontj marked this pull request as ready for review February 11, 2025 15:08
let deserialized = Catalog::from_inner(deserialized_inner);
assert_eq!(catalog, deserialized);
assert_eq!(instance_id, deserialized.instance_id());
insta::allow_duplicates! {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a neat feature in insta that allows you to make the same snapshot assertion twice, and it checks the result against the same snapshot file. I used it here to check roundtrip serialization/deserialization.

@hiltontj hiltontj merged commit 9646691 into main Feb 11, 2025
14 checks passed
@hiltontj hiltontj deleted the hiltontj/catalog-serde branch February 11, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants