mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
Limit and document chunk_size
This commit is contained in:
1 parent
7192cfbd31
commit
081db5f31c
1 file changed
+8
-1
@@ -48,13 +48,20 @@ def read_table(filename, columns=None):
|
||||
def write_table(table, filename, chunk_size=None):
|
||||
"""
|
||||
Write a Table to Parquet format
|
||||
|
||||
Parameters
|
||||
----------
|
||||
table : pyarrow.Table
|
||||
filename : string
|
||||
chunk_size : int
|
||||
The maximum number of rows in each Parquet RowGroup
|
||||
"""
|
||||
cdef Table table_ = table
|
||||
cdef CTable* ctable_ = table_.table
|
||||
cdef shared_ptr[OutputStream] sink = shared_ptr[OutputStream](new LocalFileOutputStream(filename))
|
||||
cdef int64_t chunk_size_ = 0
|
||||
if chunk_size is None:
|
||||
chunk_size_ = ctable_.num_rows()
|
||||
chunk_size_ = max(ctable_.num_rows(), int(2**16))
|
||||
else:
|
||||
chunk_size_ = chunk_size
|
||||
|
||||
|
||||
Reference in new issue
Block a user