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

[GO] Allow skipping struct fields in Parquet if tag is "-" #36793

Closed
chelseajonesr opened this issue Jul 20, 2023 · 0 comments · Fixed by #36794
Closed

[GO] Allow skipping struct fields in Parquet if tag is "-" #36793

chelseajonesr opened this issue Jul 20, 2023 · 0 comments · Fixed by #36794

Comments

@chelseajonesr
Copy link
Contributor

Describe the enhancement requested

We sometimes have struct fields that we wish to omit from Parquet serialization/deserialization.

JSON marshalling uses the field tag "-" to omit a field. I would like to be able to do the same with the parquet tag.

Component(s)

Go

zeroshade pushed a commit that referenced this issue Jul 24, 2023
…h parquet:"-" (#36794)

### Rationale for this change

Allow skipping Go struct fields when serializing to Parquet by using a tag `parquet:"-"`, similarly to the standard Go JSON implementation.

### What changes are included in this PR?

Add `Exclude` to the taggedInfo struct, which is used by `typeToNode` to skip the  associated struct field.

### Are these changes tested?

Yes, I modified an existing test to add a new excluded field.  (I'm also using this change locally to read and write parquet files with existing Go structs.)

### Are there any user-facing changes?

Yes, this modifies usage of the `parquet` tag.  I couldn't find any relevant documentation that needs to be updated though; if there is any please let me know and I will do so.
* Closes: #36793

Authored-by: Chelsea Jones <chelseajones@rivian.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
@zeroshade zeroshade added this to the 14.0.0 milestone Jul 24, 2023
R-JunmingChen pushed a commit to R-JunmingChen/arrow that referenced this issue Aug 20, 2023
…ed with parquet:"-" (apache#36794)

### Rationale for this change

Allow skipping Go struct fields when serializing to Parquet by using a tag `parquet:"-"`, similarly to the standard Go JSON implementation.

### What changes are included in this PR?

Add `Exclude` to the taggedInfo struct, which is used by `typeToNode` to skip the  associated struct field.

### Are these changes tested?

Yes, I modified an existing test to add a new excluded field.  (I'm also using this change locally to read and write parquet files with existing Go structs.)

### Are there any user-facing changes?

Yes, this modifies usage of the `parquet` tag.  I couldn't find any relevant documentation that needs to be updated though; if there is any please let me know and I will do so.
* Closes: apache#36793

Authored-by: Chelsea Jones <chelseajones@rivian.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
chelseajonesr added a commit to chelseajonesr/arrow that referenced this issue Sep 7, 2023
…ed with parquet:"-" (apache#36794)

### Rationale for this change

Allow skipping Go struct fields when serializing to Parquet by using a tag `parquet:"-"`, similarly to the standard Go JSON implementation.

### What changes are included in this PR?

Add `Exclude` to the taggedInfo struct, which is used by `typeToNode` to skip the  associated struct field.

### Are these changes tested?

Yes, I modified an existing test to add a new excluded field.  (I'm also using this change locally to read and write parquet files with existing Go structs.)

### Are there any user-facing changes?

Yes, this modifies usage of the `parquet` tag.  I couldn't find any relevant documentation that needs to be updated though; if there is any please let me know and I will do so.
* Closes: apache#36793

Authored-by: Chelsea Jones <chelseajones@rivian.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this issue Nov 13, 2023
…ed with parquet:"-" (apache#36794)

### Rationale for this change

Allow skipping Go struct fields when serializing to Parquet by using a tag `parquet:"-"`, similarly to the standard Go JSON implementation.

### What changes are included in this PR?

Add `Exclude` to the taggedInfo struct, which is used by `typeToNode` to skip the  associated struct field.

### Are these changes tested?

Yes, I modified an existing test to add a new excluded field.  (I'm also using this change locally to read and write parquet files with existing Go structs.)

### Are there any user-facing changes?

Yes, this modifies usage of the `parquet` tag.  I couldn't find any relevant documentation that needs to be updated though; if there is any please let me know and I will do so.
* Closes: apache#36793

Authored-by: Chelsea Jones <chelseajones@rivian.com>
Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants