mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-24 02:59:13 +08:00
add test
This commit is contained in:
parent
57949f9959
commit
384ed7a381
@ -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)
|
||||
|
||||
}
|
||||
|
25
weed/mq/schema/write_parquet_test.go
Normal file
25
weed/mq/schema/write_parquet_test.go
Normal file
@ -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)
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user