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

Sbfds column data changes #251

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Paul-Licameli
Copy link

Results of some microscopic code review of SBFDSColumnData.h.

The one function I haven't yet reviewed to my satisfaction is FindClosestValueIndexForValue

@Paul-Licameli Paul-Licameli requested a review from a team as a code owner September 2, 2024 22:14
@Paul-Licameli Paul-Licameli marked this pull request as draft September 2, 2024 22:14
@@ -656,10 +671,12 @@ class SBFDSColumnData

//try to insert the value if not already there
auto [inserted_id_entry, inserted] = stringIdValueEntries.emplace(string_id, nullptr);
if(inserted)
if(inserted) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Style is for newline here

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, there's logic in InsertFirstIndexIntoStringIdValueEntry to do the right thing, which mimics the logic above (line 658) for numbers.

static inline double GetMaxDifferenceTerm(const SBFDSColumnData &column,
GeneralizedDistanceEvaluator::FeatureAttributes &feature_attribs)
{
switch(feature_attribs.featureType)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should this be static rather than a method of column data?

@@ -601,7 +616,7 @@ class SBFDSColumnData
{
invalidIndices.insert(index);

if(internedNumberValues.valueInterningEnabled)
if(internedNumberValues.valueInterningEnabled || internedStringIdValues.valueInterningEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

Good find!

Copy link
Contributor

Choose a reason for hiding this comment

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

This one is important enough that I'm going to include it in another PR going in shortly to make the next release.

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.

2 participants