seaweedfs/weed/mq/schema/write_parquet_test.go
2024-04-18 22:41:20 -07:00

26 lines
587 B
Go

package schema
import (
"fmt"
"testing"
)
func TestWriteParquet(t *testing.T) {
// create a schema_pb.RecordType
recordType := NewRecordTypeBuilder().
AddLongField("ID").
AddLongField("CreatedAt").
AddRecordField("Person", NewRecordTypeBuilder().
AddStringField("Name").
AddListField("emails", TypeString)).Build()
fmt.Printf("RecordType: %v\n", recordType)
// create a parquet schema
parquetSchema, err := ToParquetSchema("example", recordType)
if err != nil {
t.Fatalf("ToParquetSchema failed: %v", err)
}
fmt.Printf("ParquetSchema: %v\n", parquetSchema)
}