Skip to content

Conversation

@Siritejagaddameedi
Copy link
Contributor

@Siritejagaddameedi Siritejagaddameedi commented Jan 28, 2025

Description

Add SQLQueryUtils support for Vacuum queries

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

  1. SQLQueryUtils didn't support for Vacuum queries

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Copy link
Collaborator

@ykmr1224 ykmr1224 left a comment

Choose a reason for hiding this comment

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

Please add DCO, and unit tests.

@ykmr1224 ykmr1224 added enhancement New feature or request backport 2.x labels Jan 28, 2025
@ykmr1224
Copy link
Collaborator

Build failed due to style check.

Comment on lines 318 to 343
@Override
public Void visitVacuumCoveringIndexStatement(
FlintSparkSqlExtensionsParser.VacuumCoveringIndexStatementContext ctx) {
indexQueryDetailsBuilder.indexQueryActionType(IndexQueryActionType.VACUUM);
indexQueryDetailsBuilder.indexType(FlintIndexType.COVERING);
return super.visitVacuumCoveringIndexStatement(ctx);
}

@Override
public Void visitVacuumSkippingIndexStatement(
FlintSparkSqlExtensionsParser.VacuumSkippingIndexStatementContext ctx) {
indexQueryDetailsBuilder.indexQueryActionType(IndexQueryActionType.VACUUM);
indexQueryDetailsBuilder.indexType(FlintIndexType.SKIPPING);
return super.visitVacuumSkippingIndexStatement(ctx);
}

@Override
public Void visitVacuumMaterializedViewStatement(
FlintSparkSqlExtensionsParser.VacuumMaterializedViewStatementContext ctx) {
indexQueryDetailsBuilder.indexQueryActionType(IndexQueryActionType.VACUUM);
indexQueryDetailsBuilder.indexType(FlintIndexType.MATERIALIZED_VIEW);
indexQueryDetailsBuilder.mvName(ctx.mvName.getText());
return super.visitVacuumMaterializedViewStatement(ctx);
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the use case for adding Vaccum in async-query-core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whenever we call SQLQueryUtils with vacuum query, it will fail to parse the query.

Copy link
Collaborator

@ykmr1224 ykmr1224 left a comment

Choose a reason for hiding this comment

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

I think you want to make this change against main branch instead of 2.x and we'll backport to 2.x once merged.

@Siritejagaddameedi Siritejagaddameedi changed the base branch from 2.x to main January 31, 2025 04:18
@Siritejagaddameedi Siritejagaddameedi changed the base branch from main to 2.x January 31, 2025 04:18
@Siritejagaddameedi Siritejagaddameedi changed the base branch from 2.x to main February 6, 2025 05:35
@Siritejagaddameedi Siritejagaddameedi changed the base branch from main to 2.x February 6, 2025 05:40
Copy link
Collaborator

@noCharger noCharger left a comment

Choose a reason for hiding this comment

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

Thanks for the change! Let's fix the DCO and add the necessary test cases, for example https://github.com/opensearch-project/sql/pull/2985/files#diff-4aba5e85641e1ff025d49ef65ad0eb29a5db4bb00d4a3d3f90ccf55a925b5a8f

Signed-off-by: Siri Teja Gaddameedi <sirigadd@amazon.com>

Add UTs

Signed-off-by: Siri Teja Gaddameedi <sirigadd@amazon.com>

Fix build

Signed-off-by: Siri Teja Gaddameedi <sirigadd@amazon.com>

Fix code style

Signed-off-by: Siri Teja Gaddameedi <sirigadd@amazon.com>
@noCharger noCharger merged commit e23a61d into opensearch-project:main Apr 11, 2025
22 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 11, 2025
Add UTs

Fix build

Fix code style

Signed-off-by: Siri Teja Gaddameedi <sirigadd@amazon.com>
Co-authored-by: Siri Teja Gaddameedi <sirigadd@amazon.com>
(cherry picked from commit e23a61d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
noCharger pushed a commit that referenced this pull request Apr 21, 2025
Add UTs

Fix build

Fix code style



(cherry picked from commit e23a61d)

Signed-off-by: Siri Teja Gaddameedi <sirigadd@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Siri Teja Gaddameedi <sirigadd@amazon.com>
penghuo pushed a commit that referenced this pull request Jun 16, 2025
Add UTs

Fix build

Fix code style

Signed-off-by: Siri Teja Gaddameedi <sirigadd@amazon.com>
Co-authored-by: Siri Teja Gaddameedi <sirigadd@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants