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

if the return error value is never to be a valid error, just remove the error definition in its signature #49977

Closed
AilinKid opened this issue Jan 2, 2024 · 0 comments · Fixed by #49975
Assignees
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@AilinKid
Copy link
Contributor

AilinKid commented Jan 2, 2024

Enhancement

for some function signatures, if the return error value is never to be a valid error, just remove the error definition in its signature.

-func (*DataSource) buildIndexMergePartialPath(indexAccessPaths []*util.AccessPath) (*util.AccessPath, error) {
+func (*DataSource) buildIndexMergePartialPath(indexAccessPaths []*util.AccessPath) *util.AccessPath {
        if len(indexAccessPaths) == 1 {
-               return indexAccessPaths[0], nil
+               return indexAccessPaths[0]
        }
 
        minEstRowIndex := 0
@@ -401,7 +401,7 @@ func (*DataSource) buildIndexMergePartialPath(indexAccessPaths []*util.AccessPat
                        minEstRow = rc
                }
        }
-       return indexAccessPaths[minEstRowIndex], nil
+       return indexAccessPaths[minEstRowIndex]
 }
@AilinKid AilinKid added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Jan 2, 2024
@AilinKid AilinKid self-assigned this Jan 2, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant