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

✨ support defining a dimension field as multi-valued #126

Merged

Conversation

gbrlcustodio
Copy link
Contributor

Hey @azaurus1, I hope you're doing well!

As we discussed on azaurus1/terraform-provider-pinot#56, this pull request is to add support for the singleValueField property. It requires a boolean to indicate if the field is single-valued or multi-valued.

The only issue I encountered was regarding how the omitempty option works. It states that the field should be excluded from the encoding if it has an empty value, defined as false, 0, a nil pointer, a nil interface value, or any empty array, slice, map, or string.

When both NotNull and SingleValueField are set to false, they are omitted.

To address this issue, I've replaced it with a boolean pointer as this issue has been extensively debated and this seems to be the simpler workaround. Alternatively, we could use a different JSON serializer. There's also a proposal for golang to support this natively, which is almost ten years old. You can find it here.

Copy link
Owner

@azaurus1 azaurus1 left a comment

Choose a reason for hiding this comment

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

Hi @gbrlcustodio, looks good, I will make this into a release, so you can reference it in the go.mod when you make the changes for terraform-provider-pinot

@azaurus1 azaurus1 merged commit cf3c8a7 into azaurus1:main Mar 28, 2024
3 of 4 checks passed
@azaurus1
Copy link
Owner

@gbrlcustodio, new release is v0.3.0

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.

2 participants