• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An ORC file format reader and writer for Go.

orc

Build Status code-coverage go-doc

Project Status

This project is still a work in progress.

Current Support

Column Encoding Read Write Go Type
SmallInt, Int, BigInt βœ“ int64
Float, Double βœ“ float32, float64
String, Char, and VarChar βœ“ string
Boolean βœ“ bool
TinyInt βœ“ byte
Binary βœ“ []byte
Decimal βœ“ orc.Decimal
Date βœ“ orc.Date (time.Time)
Timestamp βœ“ time.Time
Struct βœ“ orc.Struct (map[string]interface{})
List βœ“ []interface{}
Map βœ“ []orc.MapEntry
Union βœ“ interface{}
  • The writer support is in its late stages, however, I do not recommend using it yet.

Example

r, err := Open("./examples/demo-12-zlib.orc")
if err != nil {
    log.Fatal(err)
}
defer r.Close()

// Create a new Cursor reading the provided columns.
c := r.Select("_col0", "_col1", "_col2")

// 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)
}