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

Pre-validate duplicate columns in materialized view query #359

Merged

Conversation

dai-chen
Copy link
Collaborator

@dai-chen dai-chen commented May 29, 2024

Description

Added pre-validation for duplicate check for output columns in materialized view query. The pre-validation validateIndex() API was introduced in PR #297.

Issues Resolved

#357

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dai-chen dai-chen added bug Something isn't working 0.5 labels May 29, 2024
@dai-chen dai-chen self-assigned this May 29, 2024
@dai-chen dai-chen marked this pull request as ready for review May 29, 2024 18:33
* MV query may be empty in the case of ALTER index statement.
*/
if (query.nonEmpty) {
val outputColNames = flint.spark.sql(query).schema.map(_.name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

just curious, this will infer the returned schema instead of actually run it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, for DQL, flint.spark.sql(query).show will trigger execution

@dai-chen dai-chen merged commit c5ad7e7 into opensearch-project:main Jun 6, 2024
4 checks passed
@dai-chen dai-chen deleted the fix-duplicate-column-in-mv-query branch June 6, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.5 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Index refresh failed due to duplicate columns in materialized view query
2 participants