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

Core: Use unknown report type for forward-compatibility #7145

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

nastra
Copy link
Contributor

@nastra nastra commented Mar 20, 2023

No description provided.

@github-actions github-actions bot added the core label Mar 20, 2023
@nastra nastra closed this Mar 20, 2023
@nastra nastra reopened this Mar 20, 2023
if (report instanceof ScanReport) {
reportType = ReportType.SCAN_REPORT;
} else if (report instanceof CommitReport) {
reportType = ReportType.COMMIT_REPORT;
}

Preconditions.checkArgument(
null != reportType, "Unsupported report type: %s", report.getClass().getName());

return ImmutableReportMetricsRequest.builder().reportType(reportType).report(report).build();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't fallback to returning ReportMetricsRequest unknown() because should prefer the report that was passed in to this method in L57

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this for cases where an unknown metrics report is passed by a user rather than by Iceberg? I guess that makes sense, but I wouldn't expect it to happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wouldn't expect it to happen either, but I think it's more correct to pass-through whatever the report was in the first place (rather than defaulting to an unknown impl).

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