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

Class ParquetWriter

python/pyarrow/parquet/core.py:1038–1238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1036
1037
1038class ParquetWriter:
1039
1040 __doc__ = f"""
1041Class for incrementally building a Parquet file for Arrow tables.
1042
1043Parameters
1044----------
1045where : path or file-like object
1046schema : pyarrow.Schema
1047{_parquet_writer_arg_docs}
1048writer_engine_version : unused
1049**options : dict
1050 If options contains a key `metadata_collector` then the
1051 corresponding value is assumed to be a list (or any object with
1052 `.append` method) that will be filled with the file metadata instance
1053 of the written file.
1054
1055Examples
1056--------
1057{_parquet_writer_example_doc}
1058"""
1059
1060 def __init__(self, where, schema, filesystem=None,
1061 flavor=None,
1062 version='2.6',
1063 use_dictionary=True,
1064 compression='snappy',
1065 write_statistics=True,
1066 use_deprecated_int96_timestamps=None,
1067 compression_level=None,
1068 use_byte_stream_split=False,
1069 column_encoding=None,
1070 writer_engine_version=None,
1071 data_page_version='1.0',
1072 use_compliant_nested_type=True,
1073 encryption_properties=None,
1074 write_batch_size=None,
1075 dictionary_pagesize_limit=None,
1076 store_schema=True,
1077 write_page_index=False,
1078 write_page_checksum=False,
1079 sorting_columns=None,
1080 store_decimal_as_integer=False,
1081 write_time_adjusted_to_utc=False,
1082 max_rows_per_page=None,
1083 **options):
1084 if use_deprecated_int96_timestamps is None:
1085 # Use int96 timestamps for Spark
1086 if flavor is not None and 'spark' in flavor:
1087 use_deprecated_int96_timestamps = True
1088 else:
1089 use_deprecated_int96_timestamps = False
1090
1091 self.flavor = flavor
1092 if flavor is not None:
1093 schema, self.schema_changed = _sanitize_schema(schema, flavor)
1094 else:
1095 self.schema_changed = False

Callers 2

write_tableFunction · 0.85
write_metadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected