Skip to content

Conversation

@erezrokah
Copy link
Member

@erezrokah erezrokah commented Sep 25, 2025

Summary

Fixes cloudquery/cloudquery#14601

Still untested, opening for reference

Tested this in https://github.com/cloudquery/cloudquery-private/pull/9520 (internal link)


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@github-actions github-actions bot added the feat label Sep 25, 2025
@erezrokah erezrokah changed the title feat: Support chunks in list/details patterns feat: Support chunks in resource resolvers Sep 25, 2025
@github-actions github-actions bot added feat and removed feat labels Sep 25, 2025
@erezrokah erezrokah force-pushed the feat/list_details_arrays branch from 729634a to 105f97e Compare November 3, 2025 15:00
@erezrokah erezrokah marked this pull request as ready for review November 4, 2025 18:13
@erezrokah erezrokah requested a review from a team as a code owner November 4, 2025 18:13
type RowResolver func(ctx context.Context, meta ClientMeta, resource *Resource) error

type RowsChunkResolver struct {
ChunkSize int
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need a way of ensuring ChunkSize is always less than 100 as that is what BatchSender uses

Copy link
Contributor

Choose a reason for hiding this comment

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

Or make BatchSender batch limit configurable

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't matter:

  1. If you pass a slice on the channel BatchSender sends the slice as is
  2. If you pass individual items and whatever batch BatchSender sends is smaller than ChunkSize, you'll have a single chunk with all the data

Copy link
Contributor

@bbernays bbernays left a comment

Choose a reason for hiding this comment

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

Overall I really like this, I do think that we should mark this as experimental so that we can break the function signature if necessary as we roll this out to our official plugins and make sure we are not missing any corner cases

@marianogappa
Copy link
Contributor

Looks legit; I didn't have @bbernays context so I would have approved it. Let's wait for that and LGTM.

@murarustefaan
Copy link
Contributor

I agree w/ Ben on this, we should defo mark it as experimental so we can switch signatures if needed.

@erezrokah
Copy link
Member Author

erezrokah commented Nov 5, 2025

Made the feature experimental by adding a comment, see b3241e0#diff-abecd8d935ca8952a3554e15fa6989972dd0cea6de3410b6541931883b0d6d84R28 not sure if that's what you meant.

I also added tests b3241e0#diff-2a41f52c87ab17afdba2deeea17e1182371ee8b6a1e1e8f4fcd19450c3adaeb8R192 for sending both single items (uses batch sender) and a slice to the channel (skips batch sender).

I had to refactor our tests since:

  1. It didn't support testing records with multiple rows, only []scalar.Vector, which we shouldn't really use anymore. Those only let you create single row arrow records
  2. The test assumed records are sent over the channel in the same order as they are in the test data, which is not the case. This worked since we only ever tested a single item

@erezrokah
Copy link
Member Author

@bbernays are you satisfied with my replies? Any follow up I should do here?

@bbernays
Copy link
Contributor

bbernays commented Nov 6, 2025

@bbernays are you satisfied with my replies? Any follow up I should do here?

Yes thank you, all good to ship 🚀

@kodiakhq kodiakhq bot merged commit 087ef9a into main Nov 6, 2025
9 checks passed
@kodiakhq kodiakhq bot deleted the feat/list_details_arrays branch November 6, 2025 16:27
kodiakhq bot pushed a commit that referenced this pull request Nov 6, 2025
🤖 I have created a release *beep* *boop*
---


## [4.92.0](v4.91.0...v4.92.0) (2025-11-06)


### Features

* Support chunks in resource resolvers ([#2287](#2287)) ([087ef9a](087ef9a))


### Bug Fixes

* **deps:** Update aws-sdk-go-v2 monorepo ([#2316](#2316)) ([828c4c2](828c4c2))
* **deps:** Update golang.org/x/exp digest to a4bb9ff ([#2315](#2315)) ([4bdaf94](4bdaf94))
* **deps:** Update module github.com/cloudquery/codegen to v0.3.33 ([#2321](#2321)) ([8080660](8080660))
* **deps:** Update module github.com/samber/lo to v1.52.0 ([#2318](#2318)) ([6e4c424](6e4c424))
* **deps:** Update module golang.org/x/oauth2 to v0.32.0 ([#2319](#2319)) ([48e0e01](48e0e01))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Support arrays in list/detail pattern

5 participants