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

schema: Omit null fields from being encoded to JSON #393

Merged
merged 2 commits into from
Sep 8, 2021

Conversation

rajiv-k
Copy link
Contributor

@rajiv-k rajiv-k commented Jun 9, 2021

This patch disables encoding the Fields field of JSONSchemaItemType if its nil.

I was using tool/parquet-tools to get the schema from a parquet file generated using this library and got a bunch of null values for Fields in the output JSON schema. This PR gets rid of those null values from the JSON schema.

@rajiv-k rajiv-k marked this pull request as draft June 10, 2021 17:02
This fixes test failures due to the following compilation error:
compress/lz4.go:1: +build comment must appear before package clause and be followed by a blank line
@rajiv-k rajiv-k marked this pull request as ready for review June 10, 2021 17:11
This patch disables encoding the `Fields` field of `JSONSchemaItemType`
if its `nil` which avoids producing a bunch of noise in the schema
generated by tool/parquet-tools.
@xitongsys xitongsys merged commit 5f9f710 into xitongsys:master Sep 8, 2021
zolstein pushed a commit to zolstein/parquet-go that referenced this pull request Jun 23, 2023
To support deserializing Parquet timestamp values for xitongsys#266, there needs
to be a way to convert between different Parquet types. For example,
there might be a TIMESTAMP(isAdjustedToUTC=true, unit=MILLIS) value
stored in a file and it needs to be deserialized into a time.Time which
expects a number of nanoseconds. This PR adds a
ConvertValue(val Value, typ Type) function to the parquet.Type interface
which accepts the source Value and Type and return a Value converted to
the Type of the receiver.
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