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