xitongsys/parquet-go

write down and then just 1 successful

Closed this issue · 1 comments

type AllTypes struct {
	F1 string `parquet:"name=f1, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	F2 string `parquet:"name=f2, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
}

func TestClient_HandleParquet(t *testing.T) {
	fw, err := local.NewLocalFileWriter("all-nil.parquet")
	if err != nil {
		fmt.Println("Can't create local file", err)
		return
	}

	pw, err := writer.NewParquetWriter(fw, new(AllTypes), 4)
	if err != nil {
		fmt.Println("Can't create parquet writer", err)
		return
	}

	for i := 0; i < 10; i++ {
		value := &AllTypes{
			F1: fmt.Sprintf("f%d", i),
			F2: fmt.Sprintf("f%d", i),
		}
		if err = pw.Write(value); err != nil {
			fmt.Println("Write error", err)
		}
	}
	if err = pw.WriteStop(); err != nil {
		fmt.Println("WriteStop error", err)
		return
	}
	fw.Close()
}

image

i want to insert some data, but there is only one successful
@hangxie

that's to read pq file tool problem