MCPcopy Create free account
hub / github.com/apache/arrow / write_table

Method write_table

python/pyarrow/parquet/core.py:1200–1225  ·  view source on GitHub ↗

Write Table to the Parquet file. Parameters ---------- table : Table row_group_size : int, default None Maximum number of rows in each written row group. If None, the row group size will be the minimum of the Table size (in rows)

(self, table, row_group_size=None)

Source from the content-addressed store, hash-verified

1198 self.write_table(table, row_group_size)
1199
1200 def write_table(self, table, row_group_size=None):
1201 """
1202 Write Table to the Parquet file.
1203
1204 Parameters
1205 ----------
1206 table : Table
1207 row_group_size : int, default None
1208 Maximum number of rows in each written row group. If None,
1209 the row group size will be the minimum of the Table size (in rows)
1210 and 1024 * 1024. If set larger than 64 * 1024 * 1024 then
1211 64 * 1024 * 1024 will be used instead.
1212
1213 """
1214 if self.schema_changed:
1215 table = _sanitize_table(table, self.schema, self.flavor)
1216 assert self.is_open
1217
1218 if not table.schema.equals(self.schema, check_metadata=False):
1219 msg = (
1220 "Table schema does not match schema used to create file: \n"
1221 f"table:\n{table.schema!s} vs. \nfile:\n{self.schema!s}"
1222 )
1223 raise ValueError(msg)
1224
1225 self.writer.write_table(table, row_group_size=row_group_size)
1226
1227 def close(self):
1228 """

Callers 15

writeMethod · 0.95
write_batchMethod · 0.95
write_tableFunction · 0.45
test_write_quoting_styleFunction · 0.45
test_write_eolFunction · 0.45
test_write_null_stringFunction · 0.45
mockfsFunction · 0.45

Calls 2

_sanitize_tableFunction · 0.85
equalsMethod · 0.80

Tested by 15

test_write_quoting_styleFunction · 0.36
test_write_eolFunction · 0.36
test_write_null_stringFunction · 0.36
mockfsFunction · 0.36
promotable_mockfsFunction · 0.36
multisourcefsFunction · 0.36