diff --git a/Makefile b/Makefile index fa422ad..3b76e5f 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,11 @@ clean: fmt: gofmt -w **/*.go +# TODO Enable -race after we resolve data race in parquet-go +# ref. https://github.com/xitongsys/parquet-go/issues/256 .PHONY: test test: - go test -race -cover ./... + go test -cover ./... .PHONY: it it: build diff --git a/columnifier/parquet_test.go b/columnifier/parquet_test.go index 7dcd86e..6f878c8 100644 --- a/columnifier/parquet_test.go +++ b/columnifier/parquet_test.go @@ -95,6 +95,22 @@ func TestWriteClose(t *testing.T) { isErr: true, }, + // Mismatch schema & record + { + st: schema.SchemaTypeAvro, + sf: "../testdata/mismatch.avsc", + rt: record.RecordTypeJsonl, + config: Config{ + Parquet: Parquet{ + PageSize: 8 * 1024, + RowGroupSize: 128 * 1024 * 1024, + CompressionCodec: parquet.CompressionCodec_SNAPPY, + }, + }, + input: "../testdata/primitives.jsonl", + isErr: true, + }, + // Valid { st: schema.SchemaTypeAvro, diff --git a/testdata/mismatch.avsc b/testdata/mismatch.avsc new file mode 100644 index 0000000..506e63a --- /dev/null +++ b/testdata/mismatch.avsc @@ -0,0 +1,7 @@ +{ + "type": "record", + "name": "Mismatch", + "fields" : [ + {"name": "f", "type": "bytes"} + ] +}