我正在尝试使用Go github.com/scritchley/orc
包读取ORC文件。
我能够读取ORC文件的内容,但我也想读取ORC元数据。我找不到使用该软件包执行此操作的直接方法。
来自包装的示例:
r, err := orc.Open(localFileName)
if err != nil {
log.Fatal(err)
}
defer r.Close()
logging.Info("reader returned")
// Create a new Cursor reading the provided columns.
c := r.Select()
// Iterate over each stripe in the file.
for c.Stripes() {
// Iterate over each row in the stripe.
for c.Next() {
// Retrieve a slice of interface values for the current row.
log.Println(c.Row())
}
}
if err := c.Err(); err != nil {
log.Fatal(err)
}