-
Notifications
You must be signed in to change notification settings - Fork 180
Remove GetAlias Call #4981
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
base: main
Are you sure you want to change the base?
Remove GetAlias Call #4981
Conversation
Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
|
Warning Rate limit exceeded@aparajita31pandey has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 48 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoved runtime alias-resolution and alias-based indexName override in SelectResultSet; mapping validation now requires exactly one mapping entry and retrieves that mapping directly, with updated error messages and control flow adjusted to the single-mapping assumption. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java
🧰 Additional context used
📓 Path-based instructions (1)
**/*.java
📄 CodeRabbit inference engine (.rules/REVIEW_GUIDELINES.md)
**/*.java: UsePascalCasefor class names (e.g.,QueryExecutor)
UsecamelCasefor method and variable names (e.g.,executeQuery)
UseUPPER_SNAKE_CASEfor constants (e.g.,MAX_RETRY_COUNT)
Keep methods under 20 lines with single responsibility
All public classes and methods must have proper JavaDoc
Use specific exception types with meaningful messages for error handling
PreferOptional<T>for nullable returns in Java
Avoid unnecessary object creation in loops
UseStringBuilderfor string concatenation in loops
Validate all user inputs, especially queries
Sanitize data before logging to prevent injection attacks
Use try-with-resources for proper resource cleanup in Java
Maintain Java 11 compatibility when possible for OpenSearch 2.x
Document Calcite-specific workarounds in code
Files:
legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java
⚙️ CodeRabbit configuration file
**/*.java: - Flag methods >50 lines as potentially too complex - suggest refactoring
- Flag classes >500 lines as needing organization review
- Check for dead code, unused imports, and unused variables
- Identify code reuse opportunities across similar implementations
- Assess holistic maintainability - is code easy to understand and modify?
- Flag code that appears AI-generated without sufficient human review
- Verify Java naming conventions (PascalCase for classes, camelCase for methods/variables)
- Check for proper JavaDoc on public classes and methods
- Flag redundant comments that restate obvious code
- Ensure proper error handling with specific exception types
- Check for Optional usage instead of null returns
- Validate proper use of try-with-resources for resource management
Files:
legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
- GitHub Check: security-it-linux (25)
- GitHub Check: security-it-linux (21)
- GitHub Check: bwc-tests-full-restart (21)
- GitHub Check: build-linux (21, doc)
- GitHub Check: build-linux (25, integration)
- GitHub Check: build-linux (21, integration)
- GitHub Check: bwc-tests-rolling-upgrade (25)
- GitHub Check: build-linux (25, unit)
- GitHub Check: bwc-tests-rolling-upgrade (21)
- GitHub Check: build-linux (21, unit)
- GitHub Check: build-linux (25, doc)
- GitHub Check: bwc-tests-full-restart (25)
- GitHub Check: build-windows-macos (windows-latest, 21, -PbuildPlatform=windows, unit)
- GitHub Check: build-windows-macos (windows-latest, 25, -PbuildPlatform=windows, unit)
- GitHub Check: build-windows-macos (windows-latest, 25, -PbuildPlatform=windows, integration)
- GitHub Check: build-windows-macos (macos-14, 21, integration)
- GitHub Check: build-windows-macos (macos-14, 21, unit)
- GitHub Check: build-windows-macos (macos-14, 25, integration)
- GitHub Check: build-windows-macos (macos-14, 25, doc)
- GitHub Check: build-windows-macos (windows-latest, 21, -PbuildPlatform=windows, integration)
- GitHub Check: build-windows-macos (macos-14, 25, unit)
- GitHub Check: build-windows-macos (macos-14, 21, doc)
- GitHub Check: security-it-windows-macos (macos-14, 21)
- GitHub Check: security-it-windows-macos (macos-14, 25)
- GitHub Check: security-it-windows-macos (windows-latest, 21)
- GitHub Check: security-it-windows-macos (windows-latest, 25)
- GitHub Check: test-sql-cli-integration (21)
- GitHub Check: CodeQL-Scan (java)
- GitHub Check: WhiteSource Security Check
🔇 Additional comments (1)
legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java (1)
175-181: Verify that the mapping validation correctly handles index aliases and patterns that resolve to multiple underlying indices in JOIN queries.The change from checking index name presence to requiring
mappings.size() == 1is a significant functional change. While the review correctly notes thatloadFromEsState()is called per table in JOIN queries (which should isolate each table), the concern about index patterns and aliases resolving to multiple indices remains valid. Since aliases can point to one or more indices, you need to verify:
- How
response.mappings()behaves when a user specifies a table name that is an alias pointing to multiple indices (does ES return separate entries for each underlying index or one consolidated entry?)- Whether integration tests cover scenarios where table names resolve to multi-index aliases
- How the previous mapping resolution logic handled this case and why it was changed
If the mappings response consolidates multiple underlying indices into a single entry when queried by alias name, the change is safe. If it returns separate entries per underlying index, the validation will incorrectly reject valid multi-index alias queries.
legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java
Show resolved
Hide resolved
8b7cb6a to
66a475b
Compare
Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
|
@LantaoJin Can I please get a review ? |
Description
This diff is removes a redundant alias-resolution call via the
GET /_alias/<alias>API that requires the caller to have extra indices:admin/aliases/get privileges, which can cause permission issues when executing read queries.It instead leverages existing
GetFieldMappingcall that works for both index and alias.Tested Functionality
With Index Name
With Alias Name - Same Output
Related Issues
Resolves
#2960, opensearch-project/security#5871
Check List
--signoffor-s.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.