From 0db7369e426029c23edfd99a4f913a1fc2b361fc Mon Sep 17 00:00:00 2001 From: Rajiv Kushwaha Date: Thu, 10 Jun 2021 22:35:21 +0530 Subject: [PATCH 1/2] Reformat +build tag 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 --- compress/lz4.go | 1 + 1 file changed, 1 insertion(+) diff --git a/compress/lz4.go b/compress/lz4.go index 38e88e8d..17fa3494 100644 --- a/compress/lz4.go +++ b/compress/lz4.go @@ -1,4 +1,5 @@ // +build !no_lz4 + package compress import ( From 6c635561eda5ed865d86b2ecb61e6855a96963e7 Mon Sep 17 00:00:00 2001 From: Rajiv Kushwaha Date: Thu, 10 Jun 2021 22:36:44 +0530 Subject: [PATCH 2/2] schema: Omit null fields from being encoded to JSON 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. --- schema/json.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/json.go b/schema/json.go index 1fec0d8c..70b4205a 100644 --- a/schema/json.go +++ b/schema/json.go @@ -10,8 +10,8 @@ import ( ) type JSONSchemaItemType struct { - Tag string - Fields []*JSONSchemaItemType + Tag string `json:"Tag"` + Fields []*JSONSchemaItemType `json:"Fields,omitempty"` } func NewJSONSchemaItem() *JSONSchemaItemType {