Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lafikl/cof
Column Oriented File format. An old project i did in 2017.
https://github.com/lafikl/cof
Last synced: about 1 month ago
JSON representation
Column Oriented File format. An old project i did in 2017.
- Host: GitHub
- URL: https://github.com/lafikl/cof
- Owner: lafikl
- License: bsd-3-clause
- Created: 2022-09-02T16:27:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-02T21:01:14.000Z (about 2 years ago)
- Last Synced: 2024-06-20T19:33:05.432Z (5 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# COF
Column Oriented Files. This is a package i extracted from a bigger project that i stumbled upon when i was looking through `~/projects` directory on an old laptop that i had. The code was written in 2017. I want to see if adding genrics to it would make it better, but i'll leave that to a later time. I'm pushing it here just so i can refer to it when i need to.The other parts which i didn't publish are:
- Query Execution Engine: it accepts a json object query that can do aggregate functions, filteration, group by.
- Web UI to interface with the query execution engine.*Docs from 2017*
# Writing to a file
```go
urlCol := NewStringColumn()schema := Table{
"url": NewStringCol(),
"serverIP": NewStringCol(),
"clientIP": NewStringCol(),
"timestamp": NewStringCol(),
}store.New(schema)
bulk := []Record{}
record1 := Record{
"url": "https://google.com",
"serverIP": "94.0.0.1",
"clientIP": "127.0.0.1",
"timestamp": "1520000",
}
bulk = append(bulk, record1)
store.Batch(bulk)```