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

Method __init__

python/pyarrow/parquet/core.py:1063–1142  ·  view source on GitHub ↗
(self, where, schema, filesystem=None,
                 flavor=None,
                 version='2.6',
                 use_dictionary=True,
                 compression='snappy',
                 write_statistics=True,
                 use_deprecated_int96_timestamps=None,
                 compression_level=None,
                 use_byte_stream_split=False,
                 column_encoding=None,
                 writer_engine_version=None,
                 data_page_version='1.0',
                 use_compliant_nested_type=True,
                 encryption_properties=None,
                 write_batch_size=None,
                 dictionary_pagesize_limit=None,
                 store_schema=True,
                 write_page_index=False,
                 write_page_checksum=False,
                 sorting_columns=None,
                 store_decimal_as_integer=False,
                 write_time_adjusted_to_utc=False,
                 max_rows_per_page=None,
                 **options)

Source from the content-addressed store, hash-verified

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
1099
1100 self.schema = schema
1101 self.where = where
1102
1103 # If we open a file using a filesystem, store file handle so we can be
1104 # sure to close it when `self.close` is called.
1105 self.file_handle = None
1106
1107 filesystem, path = _resolve_filesystem_and_path(where, filesystem)
1108 if filesystem is not None:
1109 # ARROW-10480: do not auto-detect compression. While
1110 # a filename like foo.parquet.gz is nonconforming, it
1111 # shouldn't implicitly apply compression.
1112 sink = self.file_handle = filesystem.open_output_stream(
1113 path, compression=None)
1114 else:
1115 sink = where
1116 self._metadata_collector = options.pop('metadata_collector', None)
1117 engine_version = 'V2'
1118 self.writer = _parquet.ParquetWriter(
1119 sink, schema,
1120 version=version,

Callers

nothing calls this directly

Calls 3

_sanitize_schemaFunction · 0.85
open_output_streamMethod · 0.45

Tested by

no test coverage detected