diff --git a/weed/mq/schema/schema_builder_test.go b/weed/mq/schema/schema_builder_test.go index 71a884286..31a88bca9 100644 --- a/weed/mq/schema/schema_builder_test.go +++ b/weed/mq/schema/schema_builder_test.go @@ -14,13 +14,4 @@ func TestSchemaBuilder(t *testing.T) { recordType := rtb.Build() fmt.Printf("RecordType: %v\n", recordType) - recordType2 := NewRecordTypeBuilder(). - AddLongField("ID"). - AddLongField("CreatedAt"). - AddRecordField("Person", NewRecordTypeBuilder(). - AddStringField("Name"). - AddListField("emails", TypeString)).Build() - - fmt.Printf("RecordType2: %v\n", recordType2) - } diff --git a/weed/mq/schema/write_parquet_test.go b/weed/mq/schema/write_parquet_test.go new file mode 100644 index 000000000..7920bf3a1 --- /dev/null +++ b/weed/mq/schema/write_parquet_test.go @@ -0,0 +1,25 @@ +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) + +}