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

Exclude dimensions from star-tree index stored type check #13355

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

Jackie-Jiang
Copy link
Contributor

Related to #12164 and #12554

Do not check stored type for dimensions to avoid mismatching columns with '__' in column name

Copy link
Contributor

@jadami10 jadami10 left a comment

Choose a reason for hiding this comment

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

i'm fairly new to this code. Thanks for jumping on this!

@@ -67,17 +66,11 @@ public class StarTreeIndexReader implements Closeable {
*/
public StarTreeIndexReader(File segmentDirectory, SegmentMetadataImpl segmentMetadata, ReadMode readMode)
throws IOException, ConfigurationException {
Preconditions.checkNotNull(segmentDirectory);
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the reason for removing all these? It's guaranteed elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It is internal class, thus we can control all the caller behavior. We usually annotate argument that can be null with @Nullable, and skip the null check for performance reason

@@ -268,7 +267,7 @@ private synchronized void loadData()
default:
break;
}
if (CollectionUtils.isNotEmpty(_segmentMetadata.getStarTreeV2MetadataList())) {
if (_segmentMetadata.getStarTreeV2MetadataList() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you've updated it to just handle an empty list instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It cannot be empty, only null or non-empty. I modified this place to make it consistent with other callers

null,
10));
private final StarTreeV2BuilderConfig BUILDER_CONFIG = StarTreeV2BuilderConfig.fromIndexConfig(
new StarTreeIndexConfig(List.of("AirlineID", "Origin", "Dest"), List.of(), List.of("count__*", "max__ArrDelay"),
Copy link
Contributor

Choose a reason for hiding this comment

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

should one of the dimensions specifically have the <agg>__<name> format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion. Updated BaseStarTreeV2Test to capture that

@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2024

Codecov Report

Attention: Patch coverage is 73.52941% with 9 lines in your changes missing coverage. Please review.

Project coverage is 62.09%. Comparing base (59551e4) to head (c1a475f).
Report is 599 commits behind head on master.

Files Patch % Lines
...ocal/startree/v2/builder/MultipleTreesBuilder.java 50.00% 2 Missing and 1 partial ⚠️
...local/startree/v2/store/StarTreeIndexMapUtils.java 72.72% 2 Missing and 1 partial ⚠️
...gment/local/segment/store/StarTreeIndexReader.java 80.00% 0 Missing and 1 partial ⚠️
...al/startree/v2/builder/StarTreeIndexSeparator.java 90.00% 1 Missing ⚠️
...t/local/startree/v2/store/StarTreeLoaderUtils.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13355      +/-   ##
============================================
+ Coverage     61.75%   62.09%   +0.34%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2547     +111     
  Lines        133233   139941    +6708     
  Branches      20636    21724    +1088     
============================================
+ Hits          82274    86895    +4621     
- Misses        44911    46450    +1539     
- Partials       6048     6596     +548     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 62.05% <73.52%> (+0.34%) ⬆️
java-21 61.98% <73.52%> (+0.35%) ⬆️
skip-bytebuffers-false 62.08% <73.52%> (+0.33%) ⬆️
skip-bytebuffers-true 61.96% <73.52%> (+34.23%) ⬆️
temurin 62.09% <73.52%> (+0.34%) ⬆️
unittests 62.08% <73.52%> (+0.34%) ⬆️
unittests1 46.66% <0.00%> (-0.23%) ⬇️
unittests2 27.72% <73.52%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jackie-Jiang Jackie-Jiang merged commit ec1d187 into apache:master Jun 11, 2024
20 checks passed
@Jackie-Jiang Jackie-Jiang deleted the star_tree_stored_type branch June 11, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants