-
Notifications
You must be signed in to change notification settings - Fork 715
fix: default value for enable_distinct_fields #8287
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Greptile Summary
This PR makes two configuration changes related to default values for stream functionality:
-
Stream Settings Default Behavior: The main change modifies the
StreamSettingsstruct insrc/config/src/meta/stream.rsto setenable_distinct_fieldsto default totrueinstead offalse. This involves removing theDefaultderive and implementing a customDefaulttrait. The change also simplifies serde attributes by removingskip_serializing_ifconditions and fixes a serialization bug where 'disable_distinct_fields' was incorrectly used instead of 'enable_distinct_fields'. -
UTF8 View Configuration: A secondary change in
src/config/src/config.rssets the default value forutf8_view_enabledfromtruetofalse, making this feature opt-in rather than enabled by default.
The changes integrate with OpenObserve's stream management system where StreamSettings controls how streams handle distinct field tracking - a feature used for optimizing queries and managing field cardinality. The distinct fields functionality helps with query performance by tracking unique field values. The UTF8 view feature relates to how string data is processed and stored internally.
Both changes represent a shift toward more conservative defaults - enabling distinct field tracking (which is likely beneficial for most use cases) while disabling UTF8 view functionality (which may have performance or compatibility implications that require careful consideration).
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it only changes default configuration values
- Score reflects straightforward configuration changes with clear intent, though the UTF8 view change seems unrelated to the PR title
- Pay close attention to the serialization fix in stream.rs to ensure the field name correction doesn't break existing API consumers
2 files reviewed, no comments
PR Type
Bug fix, Enhancement
close #8264
Description
Fix: correct serialize field name to
enable_distinct_fieldsAdd explicit
DefaultforStreamSettingsChange default:
enable_distinct_fieldsnow trueChange default: disable
utf8_view_enabledDiagram Walkthrough
File Walkthrough
config.rs
Disable UTF-8 view by defaultsrc/config/src/config.rs
ZO_UTF8_VIEW_ENABLEDdefault to falseutf8_view_enabledunchanged otherwisestream.rs
StreamSettings defaults and serialization fixessrc/config/src/meta/stream.rs
serde(default)on fieldsDefaultimpl; setenable_distinct_fieldstrueenable_distinct_fieldsDefaultin favor of manual impl