draft for parquet parsing

This commit is contained in:
simon petit 2024-11-27 15:35:36 +00:00
parent 8eb8d86d97
commit bfc6e531cb
6 changed files with 29 additions and 1 deletions

View File

@ -6,3 +6,7 @@
(modules logical_plan)
(libraries ast)
(name logical_plan))
(library
(modules parquet)
(name parquet))

View File

@ -21,7 +21,8 @@ and generate_from_clause tables =
| _ -> failwith "Unsupported table structure"
let evaluate_plan plan =
(*let evaluate_plan plan =
match plan with
| Scan(table) ->
| _ -> failwith "Unsupported plan"
*)

9
lib/parquet.ml Normal file
View 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

View File

@ -5,3 +5,10 @@
(test
(name logical_plan_test)
(libraries ast logical_plan))
(test
(name test_parquet)
(libraries parquet)
(deps
(file ./files/parquet/mock_data.parquet)))

Binary file not shown.

7
test/test_parquet.ml Normal file
View 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)