Categorygithub.com/scritchley/orc
repositorypackage
0.0.0-20210513144143-06dddf1ad665
Repository: https://github.com/scritchley/orc.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

orc

Build Status code-coverage go-doc

Project Status

This project is still a work in progress.

Current Support

Column EncodingReadWriteGo Type
SmallInt, Int, BigIntint64
Float, Doublefloat32, float64
String, Char, and VarCharstring
Booleanbool
TinyIntbyte
Binary[]byte
Decimalorc.Decimal
Dateorc.Date (time.Time)
Timestamptime.Time
Structorc.Struct (map[string]interface{})
List[]interface{}
Map[]orc.MapEntry
Unioninterface{}
  • 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)
}