Bounded ORC columnar record interchange and selective stripe scanning
moon version --all
moon check --target all --deny-warn
moon build --target all --deny-warn
moon test --target all --deny-warn
moon run examples/log_export
moon run examples/etl
moon run examples/offline_analysis
moon run examples/scale --target native --release.\tools\windows\moon.ps1 check --target all --deny-warn
.\tools\windows\moon.ps1 test --target all --deny-warn
.\tools\windows\moon.ps1 run examples/log_exportmoon add oyjh0381/moonorc@0.1.0fn main raise {
let schema = @orc.Schema::new([
{ name: "id", kind: Long },
{ name: "label", kind: String },
])
let batch = @orc.Batch::new(schema, [
[Integer(1L), Null, Integer(3L)],
[Text("a"), Text("b"), Text("c")],
])
let file = @orc.OrcFile::open(@orc.write(batch))
let scan = file.scan(
columns=Some(["label"]),
predicate=Compare("id", Greater, Integer(2L)),
)
assert_eq(scan.next().unwrap().column("label"), [Text("c")])
}| 方面 | 已实现 | 明确不支持/不承诺 |
|---|---|---|
| 文件 | ORC 0.11/0.12 入口、protobuf tail/stripe、用户元数据 | 加密、活动文件恢复、事务/ACID、任意未来版本 |
| Schema | flat struct:boolean、byte/short/int/long、float/double、string、binary、date | nested/list/map/union、decimal、timestamp、char/varchar |
| 编码读取 | byte/boolean RLE、整数 RLEv1、RLEv2 四模式、直接与字典字符串 | 自定义列编码、未验证类型变体 |
| 压缩 | NONE、ZLIB(ORC raw DEFLATE 分块) | SNAPPY/LZO/LZ4/ZSTD |
| 写出 | ORC 0.12、DIRECT/RLEv1、重复字符串字典、nullable、多 stripe、NONE/ZLIB、用户元数据和 stripe 统计 | row-index/bloom 写出、加密、其他 codec |
| 日期 | 写出 proleptic Gregorian;读取现代日期及显式 proleptic 文件 | hybrid 日历中改革前日期自动换算 |
| 扫描 | 整 stripe 解码所需列、源行范围、可信 stripe 裁剪、精确行过滤 | SQL、row-group seek、Bloom 裁剪、远程 range IO |
moon run cmd/main --target native -- demo NEW.orc
moon run cmd/main --target native -- read INPUT.orc
moon run cmd/main --target native -- rewrite INPUT.orc NEW.orcpython -m venv _local/venv
# 激活该环境,Windows 也可直接使用 _local\venv\Scripts\python.exe
python -m pip install -r scripts/requirements-interop.txt
moon build --target native --deny-warn
python scripts/interop.py verify _build/native/debug/build/cmd/main/main.exe
python scripts/verify_repository.pypub struct Batch {
// private fields
}pub struct OrcFile {
// private fields
}fn OrcFile::row_groups(self : OrcFile, stripe_index : Int, column : String) -> Array[RowGroupInfo] raise OrcErrorpub(all) struct RowGroupInfo {
row_start : Int
row_count : Int
positions : Array[UInt64]
statistics : Statistics
} derive(Eq, Debug)pub struct Scanner {
// private fields
}pub struct Schema {
// private fields
}pub(all) struct WriteOptions {
compression : Compression
block_size : Int
stripe_rows : Int
} derive(Eq, Debug)pub struct Writer {
// private fields
}Install
Download zipBounded ORC columnar record interchange and selective stripe scanning