Skip to content

sql: clean up some long argument lists in fetchers#78539

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
jordanlewis:fetcher-arg-cleanup
Apr 19, 2022
Merged

sql: clean up some long argument lists in fetchers#78539
craig[bot] merged 2 commits intocockroachdb:masterfrom
jordanlewis:fetcher-arg-cleanup

Conversation

@jordanlewis
Copy link
Copy Markdown
Member

This PR is a pure refactor that replaces some overly-long argument lists with argument structs.

@jordanlewis jordanlewis requested a review from yuzefovich March 25, 2022 23:49
@jordanlewis jordanlewis requested review from a team as code owners March 25, 2022 23:49
@jordanlewis jordanlewis requested review from miretskiy and removed request for a team March 25, 2022 23:49
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm: Thanks!

Reviewed 14 of 14 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis and @miretskiy)


pkg/sql/row/fetcher.go, line 218 at r1 (raw file):

// Init sets up a Fetcher for a given table and index. If we are using a
// non-primary index, tables.ValNeededForCol can only refer to columns in the

nit: might as well update this comment - tables.ValNeededForCol has been removed in favor of IndexFetchSpec.

@jordanlewis jordanlewis force-pushed the fetcher-arg-cleanup branch from 099cdc1 to 829dfc7 Compare March 29, 2022 17:41
@jordanlewis
Copy link
Copy Markdown
Member Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 30, 2022

Build failed:

Previously, the argument list to row.Fetcher.Init was too long. Now, it
takes an arg struct to reduce this pain. This is a pure refactor.

Release note: None
Previously, this function had way too many arguments. Replace them with
an argument struct. This is a pure refactor.

Release note: None
@yuzefovich yuzefovich force-pushed the fetcher-arg-cleanup branch from 829dfc7 to 6cab233 Compare April 19, 2022 02:25
@jordanlewis jordanlewis requested a review from a team as a code owner April 19, 2022 02:25
@yuzefovich
Copy link
Copy Markdown
Member

Courtesy rebase, will bors it once CI is green :)

@jordanlewis
Copy link
Copy Markdown
Member Author

Thanks! Sorry, this slipped my notice - I recently reconfigured my GitHub notifications and hopefully that is going to improve my time-to-response on GitHub back to something reasonable.

@jordanlewis
Copy link
Copy Markdown
Member Author

bors r_

@jordanlewis
Copy link
Copy Markdown
Member Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 19, 2022

Build succeeded:

@craig craig bot merged commit 9246ff5 into cockroachdb:master Apr 19, 2022
@jordanlewis jordanlewis deleted the fetcher-arg-cleanup branch April 19, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants