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