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

Method write_table

python/pyarrow/parquet/core.py:1191–1216  ·  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

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

Callers 15

writeMethod · 0.95
write_batchMethod · 0.95
funcFunction · 0.45
write_tableFunction · 0.45
test_write_quoting_styleFunction · 0.45
mockfsFunction · 0.45
promotable_mockfsFunction · 0.45

Calls 2

_sanitize_tableFunction · 0.85
equalsMethod · 0.80