message: Add regression test for loading lineitem into pandas/arrow
diff: @@ -50,6 +50,16 @@ def open_connection():
  con.execute(f"SET threads={threads}")
  return con
  +
  +def write_result(benchmark_name, nrun, t):
  + bench_result = f"{benchmark_name}\t{nrun}\t{t}"
  +
  + if out_file is not None:
  + f.write(bench_result)
  + f.write('\n')
  + else:
  + print(bench_result)
  +
  def benchmark_queries(benchmark_name, con, queries):
  if verbose:
  print(benchmark_name)
  @@ -67,14 +77,28 @@ def benchmark_queries(benchmark_name, con, queries):
  if verbose:
  padding = " " * len(str(nruns))
  print(f"T{padding}: {t}s")
  + write_result(benchmark_name, nrun, t)
  - bench_result = f"{benchmark_name}\t{nrun}\t{t}"
  -
  - if out_file is not None:
  - f.write(bench_result)
  - f.write('\n')
  - else:
  - print(bench_result)
  +def run_dataload(con, type):
  + benchmark_name = type + "_load_lineitem"
  + if verbose:
  + print(benchmark_name)
  + print(type)
  + q = 'SELECT * FROM lineitem'
  + for nrun in range(nruns):
  + t = 0.0
  + start = time.time()
  + if type == 'pandas':
  + res = con.execute(q).df()
  + elif type == 'arrow':
  + res = con.execute(q).arrow()
  + end = time.time()
  + t = float(end - start)
  + del res
  + if verbose:
  + padding = " " * len(str(nruns))
  + print(f"T{padding}: {t}s")
  + write_result(benchmark_name, nrun, t)
  def run_tpch(con, prefix):
  benchmark_name = f"{prefix}tpch"
  @@ -96,6 +120,7 @@ df_con = open_connection()
  for table in tables:
  df_con.register(table, data_frames[table])
  +run_dataload(main_con, "pandas")
  run_tpch(df_con, "pandas_")
  # arrow scans
  @@ -107,4 +132,5 @@ arrow_con = open_connection()
  for table in tables:
  arrow_con.register(table, arrow_tables[table])
  +run_dataload(main_con, "arrow")
  run_tpch(arrow_con, "arrow_")
  