Skip to content

Commit

Permalink
create_arrow_columns function
Browse files Browse the repository at this point in the history
Co-authored-by: Radosław Waśko <[email protected]>
  • Loading branch information
JaroslavTulach and radeusgd committed Jun 11, 2024
1 parent bce1892 commit 807fd6d
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions test/Benchmarks/src/Table/Arithmetic.enso
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ create_table num_rows =
Runtime.assert ((t.at "Z" . value_type) == Value_Type.Integer)
t

create_arrow_columns num_rows =
column_to_arrow v:Vector -> Array =
builder = int64_new.new v.length
v.map e-> builder.append e
builder.build

v = create_vectors num_rows

x = column_to_arrow (v.at 0)
y = column_to_arrow (v.at 1)
u = column_to_arrow (v.at 2)
z = column_to_arrow (v.at 3)
[int64_plus, x, y, u, z]

foreign arrow int64_new = """
new[Int64]

Expand All @@ -51,20 +65,7 @@ type Data
arrow_u self = self.arrow.at 3
arrow_z self = self.arrow.at 4

create num_rows = Data.Value (create_table num_rows) <|
column_to_arrow v:Vector -> Array =
builder = int64_new.new v.length
v.map e-> builder.append e
builder.build

v = create_vectors num_rows

x = column_to_arrow (v.at 0)
y = column_to_arrow (v.at 1)
u = column_to_arrow (v.at 2)
z = column_to_arrow (v.at 3)
[int64_plus, x, y, u, z]

create num_rows = Data.Value (create_table num_rows) (create_arrow_columns num_rows)

collect_benches = Bench.build builder->
column_arithmetic_plus_fitting d =
Expand Down

0 comments on commit 807fd6d

Please sign in to comment.