OmniSciDB  21ac014ffc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_readcsv.py
Go to the documentation of this file.
1 import os
2 import numpy as np
3 import pyarrow as pa
4 from pyarrow import csv
5 import omniscidbe as dbe
6 import ctypes
7 ctypes._dlopen('libDBEngine.so', ctypes.RTLD_GLOBAL)
8 
9 d = dbe.PyDbEngine(data='data', calcite_port=9091)
10 assert not d.closed
11 root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
12 table = csv.read_csv(root + "/Tests/Import/datafiles/santander_top1000.csv")
13 assert table
14 d.consumeArrowTable("santander", table)
15 assert not d.closed
16 print("last step")
17 r = d.executeDML("select target from santander")
18 assert r