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