draft for parquet parsing
This commit is contained in:
parent
8eb8d86d97
commit
bfc6e531cb
4
lib/dune
4
lib/dune
@ -6,3 +6,7 @@
|
|||||||
(modules logical_plan)
|
(modules logical_plan)
|
||||||
(libraries ast)
|
(libraries ast)
|
||||||
(name logical_plan))
|
(name logical_plan))
|
||||||
|
|
||||||
|
(library
|
||||||
|
(modules parquet)
|
||||||
|
(name parquet))
|
||||||
|
@ -21,7 +21,8 @@ and generate_from_clause tables =
|
|||||||
| _ -> failwith "Unsupported table structure"
|
| _ -> failwith "Unsupported table structure"
|
||||||
|
|
||||||
|
|
||||||
let evaluate_plan plan =
|
(*let evaluate_plan plan =
|
||||||
match plan with
|
match plan with
|
||||||
| Scan(table) ->
|
| Scan(table) ->
|
||||||
| _ -> failwith "Unsupported plan"
|
| _ -> failwith "Unsupported plan"
|
||||||
|
*)
|
||||||
|
9
lib/parquet.ml
Normal file
9
lib/parquet.ml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
let parquet_check_prefix ic =
|
||||||
|
let par = really_input_string ic 4 in
|
||||||
|
"PAR1" = par
|
||||||
|
|
||||||
|
let parquet_check_suffix ic =
|
||||||
|
let len = in_channel_length ic in
|
||||||
|
seek_in ic (len - 4);
|
||||||
|
let par = really_input_string ic 4 in
|
||||||
|
"PAR1" = par
|
@ -5,3 +5,10 @@
|
|||||||
(test
|
(test
|
||||||
(name logical_plan_test)
|
(name logical_plan_test)
|
||||||
(libraries ast logical_plan))
|
(libraries ast logical_plan))
|
||||||
|
|
||||||
|
|
||||||
|
(test
|
||||||
|
(name test_parquet)
|
||||||
|
(libraries parquet)
|
||||||
|
(deps
|
||||||
|
(file ./files/parquet/mock_data.parquet)))
|
||||||
|
BIN
test/files/parquet/mock_data.parquet
Normal file
BIN
test/files/parquet/mock_data.parquet
Normal file
Binary file not shown.
7
test/test_parquet.ml
Normal file
7
test/test_parquet.ml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
open Parquet
|
||||||
|
|
||||||
|
let () =
|
||||||
|
let path = "files/parquet/mock_data.parquet" in
|
||||||
|
let ic = open_in path in
|
||||||
|
assert(parquet_check_prefix ic = true);
|
||||||
|
assert(parquet_check_suffix ic = true)
|
Loading…
Reference in New Issue
Block a user