zeroshade commented on issue #41557:
URL: https://github.com/apache/arrow/issues/41557#issuecomment-2100828205
@candiduslynx Can you provide me with some explicit sample code that shows
this issue?
When testing this against `main` on the Arrow repo I'm unable to replicate
the issue you're seeing, see below:
```go
func TestReadWriteTimestamp() {
mem := memory.DefaultAllocator
fld := arrow.Field{Name: "ts", Type: array.FixedWidthTypes.Timestamp_us}
sc := arrow.NewSchema([]arrow.Field{fld}, nil)
bldr := array.NewRecordBuilder(mem, sc)
defer bldr.Release()
tsbuilder := bldr.Field(0).(*array.TimestampBuilder)
tsbuilder.AppendValues([]arrow.Timestamp{123450000, 567890000}, nil)
rec := bldr.NewRecord()
defer rec.Release()
tbl := array.NewTableFromRecords(sc, []arrow.Record{rec})
defer tbl.Release()
// tbl schema column 1 has "UTC" for timezone!
var buf bytes.Buffer
err := pqarrow.WriteTable(tbl, &buf, tbl.NumRows(),
parquet.NewWriterProperties(parquet.WithAllocator(mem)),
pqarrow.DefaultWriterProps()))
if err != nil {
panic(err)
}
rdr := bytes.NewReader(buf.Bytes())
out, err := pqarrow.ReadTable(context.Background(), rdr,
parquet.NewReaderProperties(mem), pqarrow.ArrowReadProperties{}, mem)
if err != nil {
panic(err)
}
defer out.Release()
fmt.Println(out)
}
```
I get the output:
```shell
schema:
fields: 1
- ts: type=timestamp[us, tz=UTC]
metadata: ["PARQUET:field_id": "-1"]
ts: [[123450000 567890000]]
```
Note that it still has the UTC for the timezone in the table that I read out
from the file. What version of arrow/parquet are you using? Are you
writing/reading the table differently than in my example above?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]