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

Method __init__

python/pyarrow/parquet/core.py:1060–1139  ·  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

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

Callers

nothing calls this directly

Calls 3

_sanitize_schemaFunction · 0.85
open_output_streamMethod · 0.45

Tested by

no test coverage detected