
    z-Ph\                       d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZd dl	Z	d dl
Z
d dlZ	 d dlmZ n&# e$ rZ ed ee           d          ddZ[ww xY wd dlmZmZmZmZmZmZmZmZmZmZmZ d dlmZmZm Z m!Z!m"Z" d d	l#m$Z$m%Z%m&Z&m'Z' d
 Z(d<dZ)dZ*d Z+ e'dde+de,          Z- G d d          Z. e	j/        d          Z0d Z1d Z2d Z3dZ4dZ5 G d d          Z6d Z7dhZ8dZ9dZ: G d  d!          Z;d"Z<d#Z=dddd$dd$d d%ddddddddd$d&d'Z>e<?                    d(d)@                    d*e9f          d+e*e=          e>_A        d=d,ZBe<?                    d-d)@                    e9d.f          d/e*d0          eB_A        	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d>d4ZCd5ZDd6?                    e4eD          eC_A        	 	 	 	 d?d7ZEd@d8ZF	 	 dAd9ZG	 	 dAd:ZHd;ZIdS )B    )defaultdict)nullcontext)reduceNzPThe pyarrow installation is not built with support for the Parquet file format ())ParquetReader
StatisticsFileMetaDataRowGroupMetaDataColumnChunkMetaDataParquetSchemaColumnSchemaParquetLogicalTypeFileEncryptionPropertiesFileDecryptionPropertiesSortingColumn)LocalFileSystem
FileSystemFileType_resolve_filesystem_and_path_ensure_filesystem)guid_is_path_like_stringify_path_deprecate_apic                     t          | t                    r6| D ]2}t          |t                    rt          d          }nd}||k    r dS 3nt          | t                    rd| v S dS )Nr   T F)
isinstancebyteschrstr)valbyte
compare_tos      T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pyarrow/parquet/core.py_check_contains_nullr%   4   s    #u 	 	 	D$&&  VV


z!!tt "	 
C		 }5    Tc                    | t          |           dk    st          d | D                       rt          d          t          | d         d         t                    r| g} |rZ| D ]W}|D ]R\  }}}t          |t
                    rt          d |D                       st          |          rt          d          SX| S )z+
    Check if filters are well-formed.
    Nr   c              3   <   K   | ]}t          |          d k    V  dS )r   N)len).0fs     r$   	<genexpr>z!_check_filters.<locals>.<genexpr>G   s,      #A#AACFFaK#A#A#A#A#A#Ar&   zMalformed filtersc              3   4   K   | ]}t          |          V  d S N)r%   )r*   vs     r$   r,   z!_check_filters.<locals>.<genexpr>S   s+      AA033AAAAAAr&   zBNull-terminated binary strings are not supported as filter values.)	r)   any
ValueErrorr   r    listallr%   NotImplementedError)filterscheck_null_stringsconjunctioncolopr!   s         r$   _check_filtersr:   B   s    w<<1#A#A#A#A#A A A0111gajmS)) 	  iG 	& 
 
$/ 	 	LCS"3--AASAAAAA -S11
 20  	 Nr&   a  Predicates are expressed using an ``Expression`` or using
    the disjunctive normal form (DNF), like ``[[('x', '=', 0), ...], ...]``.
    DNF allows arbitrary boolean logical combinations of single column predicates.
    The innermost tuples each describe a single column predicate. The list of inner
    predicates is interpreted as a conjunction (AND), forming a more selective and
    multiple column predicate. Finally, the most outer list combines these filters
    as a disjunction (OR).

    Predicates may also be passed as List[Tuple]. This form is interpreted
    as a single conjunction. To express OR in predicates, one must
    use the (preferred) List[List[Tuple]] notation.

    Each tuple has format: (``key``, ``op``, ``value``) and compares the
    ``key`` with the ``value``.
    The supported ``op`` are:  ``=`` or ``==``, ``!=``, ``<``, ``>``, ``<=``,
    ``>=``, ``in`` and ``not in``. If the ``op`` is ``in`` or ``not in``, the
    ``value`` must be a collection such as a ``list``, a ``set`` or a
    ``tuple``.

    Examples:

    Using the ``Expression`` API:

    .. code-block:: python

        import pyarrow.compute as pc
        pc.field('x') = 0
        pc.field('y').isin(['a', 'b', 'c'])
        ~pc.field('y').isin({'a', 'b'})

    Using the DNF format:

    .. code-block:: python

        ('x', '=', 0)
        ('y', 'in', ['a', 'b', 'c'])
        ('z', 'not in', {'a','b'})

    c                 $   ddl m t          | j                  r| S t	          | d          } fdg }| D ]=}fd|D             }|                    t          t          j        |                     >t          t          j	        |          S )a  
    Check if filters are well-formed and convert to an ``Expression``.

    Parameters
    ----------
    filters : List[Tuple] or List[List[Tuple]]

    Notes
    -----
    See internal ``pyarrow._DNF_filter_doc`` attribute for more details.

    Examples
    --------

    >>> filters_to_expression([('foo', '==', 'bar')])
    <pyarrow.compute.Expression (foo == "bar")>

    Returns
    -------
    pyarrow.compute.Expression
        An Expression representing the filters
    r   NF)r6   c                                         |           }|dk    s|dk    r||k    S |dk    r||k    S |dk    r||k     S |dk    r||k    S |dk    r||k    S |dk    r||k    S |dk    r|                    |          S |d	k    r|                    |           S t          d
                    | ||f                    )N=z==z!=<>z<=z>=inznot inz,"{0}" is not a valid operator in predicates.)fieldisinr1   format)r8   r9   r!   rA   dss       r$   convert_single_predicatez7filters_to_expression.<locals>.convert_single_predicate   s    99d

C<4ZZC<3YY3;3YY3;4ZZC<4ZZC<4ZZ::c??"8^^JJsOO##>EE"cN$ $% % %r&   c                 2    g | ]\  }}} |||          S  rG   )r*   r8   r9   r!   rE   s       r$   
<listcomp>z)filters_to_expression.<locals>.<listcomp>   s>     
 
 
R %$S"c22
 
 
r&   )
pyarrow.datasetdatasetr   
Expressionr:   appendr   operatorand_or_)r5   disjunction_membersr7   conjunction_membersrE   rD   s       @@r$   filters_to_expressionrR      s    . !     '2=)) W???G% % % % %0  O O
 
 
 
 +
 
 

 	""6(-9L#M#MNNNN(, 3444r&   _filters_to_expressionrR   z10.0.0c                      e Zd ZdZddddddddddddddZd Zd Zd	 Zed
             Z	ed             Z
ed             Zed             ZddefdZedefd            Z	 	 ddZ	 	 ddZ	 	 ddZddZddZddZdS )ParquetFilea  
    Reader interface for a single Parquet file.

    Parameters
    ----------
    source : str, pathlib.Path, pyarrow.NativeFile, or file-like object
        Readable source. For passing bytes or buffer-like file containing a
        Parquet file, use pyarrow.BufferReader.
    metadata : FileMetaData, default None
        Use existing metadata object, rather than reading from file.
    common_metadata : FileMetaData, default None
        Will be used in reads for pandas schema metadata if not found in the
        main file's metadata, no other uses at the moment.
    read_dictionary : list
        List of column names to read directly as DictionaryArray.
    memory_map : bool, default False
        If the source is a file path, use a memory map to read file, which can
        improve performance in some environments.
    buffer_size : int, default 0
        If positive, perform read buffering when deserializing individual
        column chunks. Otherwise IO calls are unbuffered.
    pre_buffer : bool, default False
        Coalesce and issue file reads in parallel to improve performance on
        high-latency filesystems (e.g. S3). If True, Arrow will use a
        background I/O thread pool.
    coerce_int96_timestamp_unit : str, default None
        Cast timestamps that are stored in INT96 format to a particular
        resolution (e.g. 'ms'). Setting to None is equivalent to 'ns'
        and therefore INT96 timestamps will be inferred as timestamps
        in nanoseconds.
    decryption_properties : FileDecryptionProperties, default None
        File decryption properties for Parquet Modular Encryption.
    thrift_string_size_limit : int, default None
        If not None, override the maximum total string size allocated
        when decoding Thrift structures. The default limit should be
        sufficient for most Parquet files.
    thrift_container_size_limit : int, default None
        If not None, override the maximum total size of containers allocated
        when decoding Thrift structures. The default limit should be
        sufficient for most Parquet files.
    filesystem : FileSystem, default None
        If nothing passed, will be inferred based on path.
        Path will try to be found in the local on-disk filesystem otherwise
        it will be parsed as an URI to determine the filesystem.
    page_checksum_verification : bool, default False
        If True, verify the checksum for each page read from the file.

    Examples
    --------

    Generate an example PyArrow Table and write it to Parquet file:

    >>> import pyarrow as pa
    >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
    ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
    ...                              "Brittle stars", "Centipede"]})

    >>> import pyarrow.parquet as pq
    >>> pq.write_table(table, 'example.parquet')

    Create a ``ParquetFile`` object from the Parquet file:

    >>> parquet_file = pq.ParquetFile('example.parquet')

    Read the data:

    >>> parquet_file.read()
    pyarrow.Table
    n_legs: int64
    animal: string
    ----
    n_legs: [[2,2,4,4,5,100]]
    animal: [["Flamingo","Parrot","Dog","Horse","Brittle stars","Centipede"]]

    Create a ParquetFile object with "animal" column as DictionaryArray:

    >>> parquet_file = pq.ParquetFile('example.parquet',
    ...                               read_dictionary=["animal"])
    >>> parquet_file.read()
    pyarrow.Table
    n_legs: int64
    animal: dictionary<values=string, indices=int32, ordered=0>
    ----
    n_legs: [[2,2,4,4,5,100]]
    animal: [  -- dictionary:
    ["Flamingo","Parrot",...,"Brittle stars","Centipede"]  -- indices:
    [0,1,2,3,4,5]]
    NFr   )metadatacommon_metadataread_dictionary
memory_mapbuffer_size
pre_buffercoerce_int96_timestamp_unitdecryption_propertiesthrift_string_size_limitthrift_container_size_limit
filesystempage_checksum_verificationc                H   t          |dd          | _        t          |||          \  }}||                    |          }d| _        t	                      | _        | j                            ||||||||	|
||           || _        |                                 | _	        d S )NclosedT)rY   )
use_memory_maprZ   r[   rX   rV   r\   r]   r^   r_   ra   )
getattr_close_sourcer   open_input_filer   readeropenrW   _build_nested_paths_nested_paths_by_prefix)selfsourcerV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   s                 r$   __init__zParquetFile.__init__,  s     %VXt<<9J:7 7 7
F!//77F!%D#oo:#
+h(C"7%=(C'A 	 		
 		
 		
  /'+'?'?'A'A$$$r&   c                     | S r.   rG   rl   s    r$   	__enter__zParquetFile.__enter__I      r&   c                 .    |                                   d S r.   closerl   argskwargss      r$   __exit__zParquetFile.__exit__L  s    

r&   c                 "   | j         j        }t          t                    }t	          |          D ]^\  }}|d         }|dd          }	 ||                             |           |sn(d                    ||d         f          }|dd          }F_|S )Nr      T.)rh   column_pathsr   r2   	enumeraterL   join)rl   pathsresultipathkeyrests          r$   rj   zParquetFile._build_nested_pathsO  s    (T"" '' 
	  
	 GAtq'C8D s""1%%% hhT!W~..ABBx  
 r&   c                     | j         j        S )z.
        Return the Parquet metadata.
        )rh   rV   rp   s    r$   rV   zParquetFile.metadatab  s    
 {##r&   c                     | j         j        S )zG
        Return the Parquet schema, unconverted to Arrow types
        )rV   schemarp   s    r$   r   zParquetFile.schemai  s    
 }##r&   c                     | j         j        S )a  
        Return the inferred Arrow schema, converted from the whole Parquet
        file's schema

        Examples
        --------
        Generate an example Parquet file:

        >>> import pyarrow as pa
        >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'example.parquet')
        >>> parquet_file = pq.ParquetFile('example.parquet')

        Read the Arrow schema:

        >>> parquet_file.schema_arrow
        n_legs: int64
        animal: string
        )rh   schema_arrowrp   s    r$   r   zParquetFile.schema_arrowp  s    0 {''r&   c                     | j         j        S )a.  
        Return the number of row groups of the Parquet file.

        Examples
        --------
        >>> import pyarrow as pa
        >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'example.parquet')
        >>> parquet_file = pq.ParquetFile('example.parquet')

        >>> parquet_file.num_row_groups
        1
        )rh   num_row_groupsrp   s    r$   r   zParquetFile.num_row_groups  s    $ {))r&   forcec                 N    | j         s|r| j                                         d S d S r.   )rf   rh   ru   )rl   r   s     r$   ru   zParquetFile.close  s8     	  	 K	  	 r&   returnc                     | j         j        S r.   )rh   rc   rp   s    r$   rc   zParquetFile.closed  s    {!!r&   Tc                 j    |                      ||          }| j                            |||          S )a  
        Read a single row group from a Parquet file.

        Parameters
        ----------
        i : int
            Index of the individual row group that we want to read.
        columns : list
            If not None, only these columns will be read from the row group. A
            column name may be a prefix of a nested field, e.g. 'a' will select
            'a.b', 'a.c', and 'a.d.e'.
        use_threads : bool, default True
            Perform multi-threaded column reads.
        use_pandas_metadata : bool, default False
            If True and file has custom pandas schema metadata, ensure that
            index columns are also loaded.

        Returns
        -------
        pyarrow.table.Table
            Content of the row group as a table (of columns)

        Examples
        --------
        >>> import pyarrow as pa
        >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'example.parquet')
        >>> parquet_file = pq.ParquetFile('example.parquet')

        >>> parquet_file.read_row_group(0)
        pyarrow.Table
        n_legs: int64
        animal: string
        ----
        n_legs: [[2,2,4,4,5,100]]
        animal: [["Flamingo","Parrot",...,"Brittle stars","Centipede"]]
        use_pandas_metadatacolumn_indicesuse_threads)_get_column_indicesrh   read_row_group)rl   r   columnsr   r   r   s         r$   r   zParquetFile.read_row_group  sN    T 11)< 2 > >{))!N6A * C C 	Cr&   c                 j    |                      ||          }| j                            |||          S )a  
        Read a multiple row groups from a Parquet file.

        Parameters
        ----------
        row_groups : list
            Only these row groups will be read from the file.
        columns : list
            If not None, only these columns will be read from the row group. A
            column name may be a prefix of a nested field, e.g. 'a' will select
            'a.b', 'a.c', and 'a.d.e'.
        use_threads : bool, default True
            Perform multi-threaded column reads.
        use_pandas_metadata : bool, default False
            If True and file has custom pandas schema metadata, ensure that
            index columns are also loaded.

        Returns
        -------
        pyarrow.table.Table
            Content of the row groups as a table (of columns).

        Examples
        --------
        >>> import pyarrow as pa
        >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'example.parquet')
        >>> parquet_file = pq.ParquetFile('example.parquet')

        >>> parquet_file.read_row_groups([0,0])
        pyarrow.Table
        n_legs: int64
        animal: string
        ----
        n_legs: [[2,2,4,4,5,...,2,4,4,5,100]]
        animal: [["Flamingo","Parrot","Dog",...,"Brittle stars","Centipede"]]
        r   r   )r   rh   read_row_groups)rl   
row_groupsr   r   r   r   s         r$   r   zParquetFile.read_row_groups  sO    T 11)< 2 > >{**::H7B + D D 	Dr&      c                     |t          d| j        j                  }|                     ||          }| j                            ||||          }|S )a  
        Read streaming batches from a Parquet file.

        Parameters
        ----------
        batch_size : int, default 64K
            Maximum number of records to yield per batch. Batches may be
            smaller if there aren't enough rows in the file.
        row_groups : list
            Only these row groups will be read from the file.
        columns : list
            If not None, only these columns will be read from the file. A
            column name may be a prefix of a nested field, e.g. 'a' will select
            'a.b', 'a.c', and 'a.d.e'.
        use_threads : boolean, default True
            Perform multi-threaded column reads.
        use_pandas_metadata : boolean, default False
            If True and file has custom pandas schema metadata, ensure that
            index columns are also loaded.

        Yields
        ------
        pyarrow.RecordBatch
            Contents of each batch as a record batch

        Examples
        --------
        Generate an example Parquet file:

        >>> import pyarrow as pa
        >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'example.parquet')
        >>> parquet_file = pq.ParquetFile('example.parquet')
        >>> for i in parquet_file.iter_batches():
        ...     print("RecordBatch")
        ...     print(i.to_pandas())
        ...
        RecordBatch
           n_legs         animal
        0       2       Flamingo
        1       2         Parrot
        2       4            Dog
        3       4          Horse
        4       5  Brittle stars
        5     100      Centipede
        Nr   r   )r   r   r   )rangerV   r   r   rh   iter_batches)rl   
batch_sizer   r   r   r   r   batchess           r$   r   zParquetFile.iter_batches  sq    f q$-">??J11)< 2 > > +**:6@:H7B + D D r&   c                 h    |                      ||          }| j                            ||          S )aW  
        Read a Table from Parquet format.

        Parameters
        ----------
        columns : list
            If not None, only these columns will be read from the file. A
            column name may be a prefix of a nested field, e.g. 'a' will select
            'a.b', 'a.c', and 'a.d.e'.
        use_threads : bool, default True
            Perform multi-threaded column reads.
        use_pandas_metadata : bool, default False
            If True and file has custom pandas schema metadata, ensure that
            index columns are also loaded.

        Returns
        -------
        pyarrow.table.Table
            Content of the file as a table (of columns).

        Examples
        --------
        Generate an example Parquet file:

        >>> import pyarrow as pa
        >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'example.parquet')
        >>> parquet_file = pq.ParquetFile('example.parquet')

        Read a Table:

        >>> parquet_file.read(columns=["animal"])
        pyarrow.Table
        animal: string
        ----
        animal: [["Flamingo","Parrot",...,"Brittle stars","Centipede"]]
        r   r   )r   rh   read_all)rl   r   r   r   r   s        r$   readzParquetFile.readC  sI    R 11)< 2 > >{##>0; $ = = 	=r&   c                 d    |                      |          }| j                            ||          S )a  
        Read contents of file for the given columns and batch size.

        Notes
        -----
        This function's primary purpose is benchmarking.
        The scan is executed on a single thread.

        Parameters
        ----------
        columns : list of integers, default None
            Select columns to read, if None scan all columns.
        batch_size : int, default 64K
            Number of rows to read at a time internally.

        Returns
        -------
        num_rows : int
            Number of rows in file

        Examples
        --------
        >>> import pyarrow as pa
        >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'example.parquet')
        >>> parquet_file = pq.ParquetFile('example.parquet')

        >>> parquet_file.scan_contents()
        6
        )r   )r   rh   scan_contents)rl   r   r   r   s       r$   r   zParquetFile.scan_contentsq  s?    D 11'::{((4> ) @ @ 	@r&   c                 <    |d S g }|D ]+}| j         v r |                     j         |                    ,|rd j        j        } j         j        j        nd }|rd|v rt	          |          }n|rd|v rt	          |          }ng }||r| fd|D             z  }|S )N   pandasc                 n    g | ]1}t          |t                    j                            |          2S rG   )r   dictrh   column_name_idx)r*   descrrl   s     r$   rH   z3ParquetFile._get_column_indices.<locals>.<listcomp>  sH     < < < %#-eT#:#:<DK77>> < < <r&   )rk   extendrV   rW   _get_pandas_index_columns)rl   column_namesr   indicesnamefile_keyvaluescommon_keyvaluesindex_columnss   `       r$   r   zParquetFile._get_column_indices  s   4  	C 	CDt333t;DABBB 	<!]3N#'#7#C !% 4 = =%)   #)~"="= 9. I I! #i3C&C&C 9:J K K ""}" < < < <)6< < < < r&   )FNTF)r   NNTF)Nr   )__name__
__module____qualname____doc__rn   rq   ry   rj   propertyrV   r   r   r   boolru   rc   r   r   r   r   r   r   rG   r&   r$   rU   rU      s       W Wr ,0!%%Q!t'+d-1d,1B B B B B:      & $ $ X$ $ $ X$ ( ( X(2 * * X*&   4         " " " " X" ;?+0-C -C -C -C^ EI,1.D .D .D .D` GK;@< < < <|,= ,= ,= ,=\$@ $@ $@ $@L     r&   rU   z[ ,;{}()
	=]c                 8    t                               d|           S )N_)_SPARK_DISALLOWED_CHARSsub)r   s    r$   _sanitized_spark_field_namer     s    "&&sD111r&   c                 @   d|v rg }d}| D ]q}|j         }t          |          }||k    r>d}t          j        ||j        |j        |j                  }|                    |           \|                    |           rt          j        || j                  }||fS | dfS )NsparkFT)rV   )	r   r   parA   typenullablerV   rL   r   )	r   flavorsanitized_fieldsschema_changedrA   r   sanitized_namesanitized_field
new_schemas	            r$   _sanitize_schemar     s    & 
	/ 
	/E:D8>>N%%!%"$(>5:+0>5>#K #K ''8888 ''....Y/&/JJJ
>))u}r&   c                      d|v rA fdt           j                  D             }t          j                            ||          S  S )Nr   c                      g | ]
}|         S rG   rG   )r*   r   tables     r$   rH   z#_sanitize_table.<locals>.<listcomp>  s    BBBAuQxBBBr&   )r   )r   num_columnsr   Tablefrom_arrays)r   r   r   column_datas   `   r$   _sanitize_tabler     sR    &BBBBu/@)A)ABBBx##K
#CCCr&   a#  version : {"1.0", "2.4", "2.6"}, default "2.6"
    Determine which Parquet logical types are available for use, whether the
    reduced set from the Parquet 1.x.x format or the expanded logical types
    added in later format versions.
    Files written with version='2.4' or '2.6' may not be readable in all
    Parquet implementations, so version='1.0' is likely the choice that
    maximizes file compatibility.
    UINT32 and some logical types are only available with version '2.4'.
    Nanosecond timestamps are only available with version '2.6'.
    Other features such as compression algorithms or the new serialized
    data page format must be enabled separately (see 'compression' and
    'data_page_version').
use_dictionary : bool or list, default True
    Specify if we should use dictionary encoding in general or only for
    some columns.
    When encoding the column, if the dictionary size is too large, the
    column will fallback to ``PLAIN`` encoding. Specially, ``BOOLEAN`` type
    doesn't support dictionary encoding.
compression : str or dict, default 'snappy'
    Specify the compression codec, either on a general basis or per-column.
    Valid values: {'NONE', 'SNAPPY', 'GZIP', 'BROTLI', 'LZ4', 'ZSTD'}.
write_statistics : bool or list, default True
    Specify if we should write statistics in general (default is True) or only
    for some columns.
use_deprecated_int96_timestamps : bool, default None
    Write timestamps to INT96 Parquet format. Defaults to False unless enabled
    by flavor argument. This take priority over the coerce_timestamps option.
coerce_timestamps : str, default None
    Cast timestamps to a particular resolution. If omitted, defaults are chosen
    depending on `version`. For ``version='1.0'`` and ``version='2.4'``,
    nanoseconds are cast to microseconds ('us'), while for
    ``version='2.6'`` (the default), they are written natively without loss
    of resolution.  Seconds are always cast to milliseconds ('ms') by default,
    as Parquet does not have any temporal type with seconds resolution.
    If the casting results in loss of data, it will raise an exception
    unless ``allow_truncated_timestamps=True`` is given.
    Valid values: {None, 'ms', 'us'}
allow_truncated_timestamps : bool, default False
    Allow loss of data when coercing timestamps to a particular
    resolution. E.g. if microsecond or nanosecond data is lost when coercing to
    'ms', do not raise an exception. Passing ``allow_truncated_timestamp=True``
    will NOT result in the truncation exception being ignored unless
    ``coerce_timestamps`` is not None.
data_page_size : int, default None
    Set a target threshold for the approximate encoded size of data
    pages within a column chunk (in bytes). If None, use the default data page
    size of 1MByte.
flavor : {'spark'}, default None
    Sanitize schema or set other compatibility options to work with
    various target systems.
filesystem : FileSystem, default None
    If nothing passed, will be inferred from `where` if path-like, else
    `where` is already a file-like object so no filesystem is needed.
compression_level : int or dict, default None
    Specify the compression level for a codec, either on a general basis or
    per-column. If None is passed, arrow selects the compression level for
    the compression codec in use. The compression level has a different
    meaning for each codec, so you have to read the documentation of the
    codec you are using.
    An exception is thrown if the compression codec does not allow specifying
    a compression level.
use_byte_stream_split : bool or list, default False
    Specify if the byte_stream_split encoding should be used in general or
    only for some columns. If both dictionary and byte_stream_stream are
    enabled, then dictionary is preferred.
    The byte_stream_split encoding is valid for integer, floating-point
    and fixed-size binary data types (including decimals); it should be
    combined with a compression codec so as to achieve size reduction.
column_encoding : string or dict, default None
    Specify the encoding scheme on a per column basis.
    Can only be used when ``use_dictionary`` is set to False, and
    cannot be used in combination with ``use_byte_stream_split``.
    Currently supported values: {'PLAIN', 'BYTE_STREAM_SPLIT',
    'DELTA_BINARY_PACKED', 'DELTA_LENGTH_BYTE_ARRAY', 'DELTA_BYTE_ARRAY'}.
    Certain encodings are only compatible with certain data types.
    Please refer to the encodings section of `Reading and writing Parquet
    files <https://arrow.apache.org/docs/cpp/parquet.html#encodings>`_.
data_page_version : {"1.0", "2.0"}, default "1.0"
    The serialized Parquet data page format version to write, defaults to
    1.0. This does not impact the file schema logical types and Arrow to
    Parquet type casting behavior; for that use the "version" option.
use_compliant_nested_type : bool, default True
    Whether to write compliant Parquet nested type (lists) as defined
    `here <https://github.com/apache/parquet-format/blob/master/
    LogicalTypes.md#nested-types>`_, defaults to ``True``.
    For ``use_compliant_nested_type=True``, this will write into a list
    with 3-level structure where the middle level, named ``list``,
    is a repeated group with a single field named ``element``::

        <list-repetition> group <name> (LIST) {
            repeated group list {
                  <element-repetition> <element-type> element;
            }
        }

    For ``use_compliant_nested_type=False``, this will also write into a list
    with 3-level structure, where the name of the single field of the middle
    level ``list`` is taken from the element name for nested columns in Arrow,
    which defaults to ``item``::

        <list-repetition> group <name> (LIST) {
            repeated group list {
                <element-repetition> <element-type> item;
            }
        }
encryption_properties : FileEncryptionProperties, default None
    File encryption properties for Parquet Modular Encryption.
    If None, no encryption will be done.
    The encryption properties can be created using:
    ``CryptoFactory.file_encryption_properties()``.
write_batch_size : int, default None
    Number of values to write to a page at a time. If None, use the default of
    1024. ``write_batch_size`` is complementary to ``data_page_size``. If pages
    are exceeding the ``data_page_size`` due to large column values, lowering
    the batch size can help keep page sizes closer to the intended size.
dictionary_pagesize_limit : int, default None
    Specify the dictionary page size limit per row group. If None, use the
    default 1MB.
store_schema : bool, default True
    By default, the Arrow schema is serialized and stored in the Parquet
    file metadata (in the "ARROW:schema" key). When reading the file,
    if this key is available, it will be used to more faithfully recreate
    the original Arrow data. For example, for tz-aware timestamp columns
    it will restore the timezone (Parquet only stores the UTC values without
    timezone), or columns with duration type will be restored from the int64
    Parquet column.
write_page_index : bool, default False
    Whether to write a page index in general for all columns.
    Writing statistics to the page index disables the old method of writing
    statistics to each data page header. The page index makes statistics-based
    filtering more efficient than the page header, as it gathers all the
    statistics for a Parquet file in a single place, avoiding scattered I/O.
    Note that the page index is not yet used on the read size by PyArrow.
write_page_checksum : bool, default False
    Whether to write page checksums in general for all columns.
    Page checksums enable detection of data corruption, which might occur during
    transmission or in the storage.
sorting_columns : Sequence of SortingColumn, default None
    Specify the sort order of the data being written. The writer does not sort
    the data nor does it verify that the data is sorted. The sort order is
    written to the row group metadata, which can then be used by readers.
store_decimal_as_integer : bool, default False
    Allow decimals with 1 <= precision <= 18 to be stored as integers.
    In Parquet, DECIMAL can be stored in any of the following physical types:
    - int32: for 1 <= precision <= 9.
    - int64: for 10 <= precision <= 18.
    - fixed_len_byte_array: precision is limited by the array size.
      Length n can store <= floor(log_10(2^(8*n - 1) - 1)) base-10 digits.
    - binary: precision is unlimited. The minimum number of bytes to store the
      unscaled value is used.

    By default, this is DISABLED and all decimal types annotate fixed_len_byte_array.
    When enabled, the writer will use the following physical types to store decimals:
    - int32: for 1 <= precision <= 9.
    - int64: for 10 <= precision <= 18.
    - fixed_len_byte_array: for precision > 18.

    As a consequence, decimal columns stored in integer types are more compact.
at  Generate an example PyArrow Table and RecordBatch:

>>> import pyarrow as pa
>>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
...                              "Brittle stars", "Centipede"]})
>>> batch = pa.record_batch([[2, 2, 4, 4, 5, 100],
...                         ["Flamingo", "Parrot", "Dog", "Horse",
...                          "Brittle stars", "Centipede"]],
...                         names=['n_legs', 'animal'])

create a ParquetWriter object:

>>> import pyarrow.parquet as pq
>>> writer = pq.ParquetWriter('example.parquet', table.schema)

and write the Table into the Parquet file:

>>> writer.write_table(table)
>>> writer.close()

>>> pq.read_table('example.parquet').to_pandas()
   n_legs         animal
0       2       Flamingo
1       2         Parrot
2       4            Dog
3       4          Horse
4       5  Brittle stars
5     100      Centipede

create a ParquetWriter object for the RecordBatch:

>>> writer2 = pq.ParquetWriter('example2.parquet', batch.schema)

and write the RecordBatch into the Parquet file:

>>> writer2.write_batch(batch)
>>> writer2.close()

>>> pq.read_table('example2.parquet').to_pandas()
   n_legs         animal
0       2       Flamingo
1       2         Parrot
2       4            Dog
3       4          Horse
4       5  Brittle stars
5     100      Centipede
c                       e Zd Zd                    ee          Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZd	 Zd
 Z	d Z
ddZddZddZd Zd ZdS )ParquetWritera  
Class for incrementally building a Parquet file for Arrow tables.

Parameters
----------
where : path or file-like object
schema : pyarrow.Schema
{}
writer_engine_version : unused
**options : dict
    If options contains a key `metadata_collector` then the
    corresponding value is assumed to be a list (or any object with
    `.append` method) that will be filled with the file metadata instance
    of the written file.

Examples
--------
{}
N2.6TsnappyF1.0c                    |	|d|v rd}	nd}	|| _         |t          ||          \  }| _        nd| _        || _        || _        d | _        t          ||          \  }}||                    |d           x}| _        n|}|                    dd           | _	        d}t          j        ||fi d|d|d	|d
|d|	d|
d|d|d|d|d|d|d|d|d|d|d|d|d||| _        d| _        d S )Nr   TF)compressionmetadata_collectorV2versionr   use_dictionarywrite_statisticsuse_deprecated_int96_timestampscompression_leveluse_byte_stream_splitcolumn_encodingwriter_engine_versiondata_page_versionuse_compliant_nested_typeencryption_propertieswrite_batch_sizedictionary_pagesize_limitstore_schemawrite_page_indexwrite_page_checksumsorting_columnsstore_decimal_as_integer)r   r   r   r   wherefile_handler   open_output_streampop_metadata_collector_parquetr   writeris_open)rl   r   r   r`   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   optionsr   sinkengine_versions                               r$   rn   zParquetWriter.__init__  s    , +2!g&7&726//27/*:66*J*J'FD''"'D
  7zJJ
D! '1&C&C$ 'D '( '( (D4## D#*;;/CT#J#J ,&  G $ *>	
 .- -L,K 0/ #8"7 ,O #1. 0/ '@&? #8"7 .- '@&?  &!" .-#$ !4 3%& ,O'( &>%=+ , r&   c                 T    t          | dd          r|                                  d S d S )Nr   F)re   ru   rp   s    r$   __del__zParquetWriter.__del__  s1    4E** 	JJLLLLL	 	r&   c                     | S r.   rG   rp   s    r$   rq   zParquetWriter.__enter__  rr   r&   c                 .    |                                   dS )NFrt   rv   s      r$   ry   zParquetWriter.__exit__  s    

ur&   c                    t          |t          j                  r|                     ||           dS t          |t          j                  r|                     ||           dS t          t          |                    )a{  
        Write RecordBatch or Table to the Parquet file.

        Parameters
        ----------
        table_or_batch : {RecordBatch, Table}
        row_group_size : int, default None
            Maximum number of rows in each written row group. If None,
            the row group size will be the minimum of the input
            table or batch length and 1024 * 1024.
        N)r   r   RecordBatchwrite_batchr   write_table	TypeErrorr   )rl   table_or_batchrow_group_sizes      r$   writezParquetWriter.write   sz     nbn55 	2^^<<<<<11 	2^^<<<<<D00111r&   c                 ~    t           j                            |g|j                  }|                     ||           dS )a  
        Write RecordBatch to the Parquet file.

        Parameters
        ----------
        batch : RecordBatch
        row_group_size : int, default None
            Maximum number of rows in written row group. If None, the
            row group size will be the minimum of the RecordBatch
            size and 1024 * 1024.  If set larger than 64Mi then 64Mi
            will be used instead.
        N)r   r   from_batchesr   r  )rl   batchr  r   s       r$   r  zParquetWriter.write_batch3  s;     %%ugu|<</////r&   c                 4   | j         rt          || j        | j                  }| j        sJ |j                            | j        d          s/d                    |j        | j                  }t          |          | j        	                    ||           dS )a  
        Write Table to the Parquet file.

        Parameters
        ----------
        table : Table
        row_group_size : int, default None
            Maximum number of rows in each written row group. If None,
            the row group size will be the minimum of the Table size
            and 1024 * 1024.  If set larger than 64Mi then 64Mi will
            be used instead.

        F)check_metadatazTTable schema does not match schema used to create file: 
table:
{!s} vs. 
file:
{!s}r  N)
r   r   r   r   r   equalsrC   r1   r   r  )rl   r   r  msgs       r$   r  zParquetWriter.write_tableC  s      	E#E4;DDE||""4;u"EE 	"6F5<55  S//!nEEEEEr&   c                     | j         rK| j                                         d| _         | j        $| j                            | j        j                   | j        | j                                         dS dS )z;
        Close the connection to the Parquet file.
        FN)r   r   ru   r   rL   rV   r   rp   s    r$   ru   zParquetWriter.close]  s{     < 	FK DL'3(//0DEEE'""$$$$$ ('r&   c                 L    | j         sJ | j                            |           dS )a	  
        Add key-value metadata to the file.
        This will overwrite any existing metadata with the same key.

        Parameters
        ----------
        key_value_metadata : dict
            Keys and values must be string-like / coercible to bytes.
        N)r   r   add_key_value_metadata)rl   key_value_metadatas     r$   r  z$ParquetWriter.add_key_value_metadatai  s/     |**+=>>>>>r&   )NNr   Tr   TNNFNNr   TNNNTFFNFr.   )r   r   r   rC   _parquet_writer_arg_docs_parquet_writer_example_docr   rn   r   rq   ry   r  r  r  ru   r  rG   r&   r$   r   r     s       $ F#%@AA% ( 26 $%"&15#'',!%'+#(+/'+"&+/""'%*!%*/)K K K KZ      
2 2 2 2&0 0 0 0 F F F F4
% 
% 
%? ? ? ? ?r&   r   c                 h    t          j        | d                             d                    d         S )Nr   utf8r   )jsonloadsdecode)	keyvaluess    r$   r   r   w  s/    Jy+226::;; r&   _SUCCESSa  read_dictionary : list, default None
    List of names or column paths (for nested types) to read directly
    as DictionaryArray. Only supported for BYTE_ARRAY storage. To read
    a flat column as dictionary-encoded pass the column name. For
    nested types, you must pass the full column "path", which could be
    something like level1.level2.list.item. Refer to the Parquet
    file's schema to obtain the paths.
memory_map : bool, default False
    If the source is a file path, use a memory map to read file, which can
    improve performance in some environments.
buffer_size : int, default 0
    If positive, perform read buffering when deserializing individual
    column chunks. Otherwise IO calls are unbuffered.
partitioning : pyarrow.dataset.Partitioning or str or list of str, default "hive"
    The partitioning scheme for a partitioned dataset. The default of "hive"
    assumes directory names with key=value pairs like "/year=2009/month=11".
    In addition, a scheme like "/2009/11" is also supported, in which case
    you need to specify the field names or a full schema. See the
    ``pyarrow.dataset.partitioning()`` function for more details.aa  Generate an example PyArrow Table and write it to a partitioned dataset:

>>> import pyarrow as pa
>>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
...                   'n_legs': [2, 2, 4, 4, 5, 100],
...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
...                              "Brittle stars", "Centipede"]})
>>> import pyarrow.parquet as pq
>>> pq.write_to_dataset(table, root_path='dataset_v2',
...                     partition_cols=['year'])

create a ParquetDataset object from the dataset source:

>>> dataset = pq.ParquetDataset('dataset_v2/')

and read the data:

>>> dataset.read().to_pandas()
   n_legs         animal  year
0       5  Brittle stars  2019
1       2       Flamingo  2020
2       4            Dog  2021
3     100      Centipede  2021
4       2         Parrot  2022
5       4          Horse  2022

create a ParquetDataset object with filter:

>>> dataset = pq.ParquetDataset('dataset_v2/',
...                             filters=[('n_legs','=',4)])
>>> dataset.read().to_pandas()
   n_legs animal  year
0       4    Dog  2021
1       4  Horse  2022
c                       e Zd Zd                    eee          ZdddddddddddddddZd Z	d	 Z
ed
             ZddZd Zd Zed             Zed             Zed             Zed             ZdS )ParquetDataseta
  
Encapsulates details of reading a complete Parquet dataset possibly
consisting of multiple files and partitions in subdirectories.

Parameters
----------
path_or_paths : str or List[str]
    A directory name, single file name, or list of file names.
filesystem : FileSystem, default None
    If nothing passed, will be inferred based on path.
    Path will try to be found in the local on-disk filesystem otherwise
    it will be parsed as an URI to determine the filesystem.
schema : pyarrow.parquet.Schema
    Optionally provide the Schema for the Dataset, in which case it will
    not be inferred from the source.
filters : pyarrow.compute.Expression or List[Tuple] or List[List[Tuple]], default None
    Rows which do not match the filter predicate will be removed from scanned
    data. Partition keys embedded in a nested directory structure will be
    exploited to avoid loading files at all if they contain no matching rows.
    Within-file level filtering and different partitioning schemes are supported.

    {1}
{0}
ignore_prefixes : list, optional
    Files matching any of these prefixes will be ignored by the
    discovery process.
    This is matched to the basename of a path.
    By default this is ['.', '_'].
    Note that discovery happens only if a directory is passed as source.
pre_buffer : bool, default True
    Coalesce and issue file reads in parallel to improve performance on
    high-latency filesystems (e.g. S3, GCS). If True, Arrow will use a
    background I/O thread pool. If using a filesystem layer that itself
    performs readahead (e.g. fsspec's S3FS), disable readahead for best
    results. Set to False if you want to prioritize minimal memory usage
    over maximum speed.
coerce_int96_timestamp_unit : str, default None
    Cast timestamps that are stored in INT96 format to a particular resolution
    (e.g. 'ms'). Setting to None is equivalent to 'ns' and therefore INT96
    timestamps will be inferred as timestamps in nanoseconds.
decryption_properties : FileDecryptionProperties or None
    File-level decryption properties.
    The decryption properties can be created using
    ``CryptoFactory.file_decryption_properties()``.
thrift_string_size_limit : int, default None
    If not None, override the maximum total string size allocated
    when decoding Thrift structures. The default limit should be
    sufficient for most Parquet files.
thrift_container_size_limit : int, default None
    If not None, override the maximum total size of containers allocated
    when decoding Thrift structures. The default limit should be
    sufficient for most Parquet files.
page_checksum_verification : bool, default False
    If True, verify the page checksum for each page read from the file.

Examples
--------
{2}
NFhiveT)r5   rX   rY   rZ   partitioningignore_prefixesr[   r\   r]   r^   r_   ra   c                F   dd l m} |
||||d}|r|                    d|           ||                    |           ||                    |           d | _        |t	          |          | _        |t          ||          }n||rt          |          }t          |d          r6|4t          |t                    st          d	t          |                     d }d | _        t          |t                    st          |          r|t          |          }|9	 t          j        |          \  }}n # t"          $ r t          |          }Y nw xY w|                    |          }|j
        t&          j        k    r|| _        n|} |j        di |}|C|                    ||          }|                    |g|p|j        ||j        
          | _        d S |dk    r|j                            d          }|                    ||||||	          | _        d S )Nr   )r[   r\   r^   r_   ra   T)use_buffered_streamrZ   )dictionary_columns)r]   )use_mmap
__fspath__zQPath-like objects with __fspath__ must only be used with local file systems, not )r   rC   r`   r  )infer_dictionary)r`   r   rC   r   r!  rG   )rI   rJ   update_filter_expressionrR   r   r   hasattrr   r  r   	_base_dirr2   r   r   r   from_urir1   get_file_infor   	DirectoryParquetFileFormatmake_fragmentFileSystemDatasetphysical_schemar`   _datasetHivePartitioningdiscover)rl   path_or_pathsr`   r   r5   rX   rY   rZ   r   r!  r[   r\   r]   r^   r_   ra   rD   read_optionssingle_filefinfoparquet_formatfragments                         r$   rn   zParquetDataset.__init__  s    	%$$$$$ %+F(@+F*D
 
  	9D,7   9 9 9&?CCC ,6KLLL"&&;G&D&DD# !+Z1 1 1JJJ )*===J
 M<00	":77 # >+/
+;+;> >   -.. 	,]++ , / > >%J4>4G)5+ 5+1
MM% J J J%4j%I%I%I


J"00??:!333%2DN+--===="%33KLLH00
6#EX-E%#. 1  DM
 F 6!!.77!% 8 ' 'L 

=Z*00<3B # D Ds   "D: :EEc                     t          |t                    st          d          | j        |j        k    o9| j        j        |j        j        k    o| j        |j        k    o| j        |j        k    S )Nz-`other` must be an instance of ParquetDataset)r   r  r  r   r3  rC   r`   filesrl   others     r$   r  zParquetDataset.equalsV  sq    %00 	MKLLLu|+ *$(==*5#33* 
ek)		+r&   c                 \    	 |                      |          S # t          $ r
 t          cY S w xY wr.   )r  r  NotImplementedr>  s     r$   __eq__zParquetDataset.__eq__`  s@    	";;u%%% 	" 	" 	"!!!!	"s    ++c                     | j         j        S )a>  
        Schema of the Dataset.

        Examples
        --------
        Generate an example dataset:

        >>> import pyarrow as pa
        >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
        ...                   'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_to_dataset(table, root_path='dataset_v2_schema',
        ...                     partition_cols=['year'])
        >>> dataset = pq.ParquetDataset('dataset_v2_schema/')

        Read the schema:

        >>> dataset.schema
        n_legs: int64
        animal: string
        year: dictionary<values=int32, indices=int32, ordered=0>
        )r3  r   rp   s    r$   r   zParquetDataset.schemaf  s    4 }##r&   c                    | j         j        pi }|rd|vr|                                 }|r|}|]|r[|rYd|v rUd t          |          D             }t	          |          t	          t          |          t          |          z
            z   }| j                            || j        |          }|rF|rDd|v r@|j         j        pi }|	                    d|d         i           |
                    |          }|S )a  
        Read (multiple) Parquet files as a single pyarrow.Table.

        Parameters
        ----------
        columns : List[str]
            Names of columns to read from the dataset. The partition fields
            are not automatically included.
        use_threads : bool, default True
            Perform multi-threaded column reads.
        use_pandas_metadata : bool, default False
            If True and file has custom pandas schema metadata, ensure that
            index columns are also loaded.

        Returns
        -------
        pyarrow.Table
            Content of the file as a table (of columns).

        Examples
        --------
        Generate an example dataset:

        >>> import pyarrow as pa
        >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
        ...                   'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_to_dataset(table, root_path='dataset_v2_read',
        ...                     partition_cols=['year'])
        >>> dataset = pq.ParquetDataset('dataset_v2_read/')

        Read the dataset:

        >>> dataset.read(columns=["n_legs"])
        pyarrow.Table
        n_legs: int64
        ----
        n_legs: [[5],[2],[4,100],[2,4]]
        r   Nc                 <    g | ]}t          |t                    |S rG   )r   r   )r*   r8   s     r$   rH   z'ParquetDataset.read.<locals>.<listcomp>  s8     ! ! !%c400!! ! !r&   )r   filterr   )r   rV   _get_common_pandas_metadatar   r2   setr3  to_tabler)  r(  replace_schema_metadata)	rl   r   r   r   rV   rW   r   r   new_metadatas	            r$   r   zParquetDataset.read  sG   X ;'-2 	/ (("&"B"B"D"D" /.H#6 I11! !#<X#F#F! ! !
 MMD]););c'll)J$K$KK  &&D$;# ' 
 
  	D DI11$|4:##Y0C$DEEE55lCCr&   c                    | j         sd S d }dD ]z}t          j                            t	          | j                   |          }| j                            |          }|j        r%t          || j                  }|j	        }|rd|v r n{|S )N)_common_metadata	_metadatar`   r   )
r+  osr   r   r    r`   r-  is_fileread_metadatarV   )rl   rV   r   metadata_pathr9  pq_metas         r$   rG  z*ParquetDataset._get_common_pandas_metadata  s    ~ 	45 	 	DGLLT^)<)<dCCMO11-@@E} '!do? ? ?"+ 	X 5 5Er&   c                       | j         dddi|S )a  
        Read dataset including pandas metadata, if any. Other arguments passed
        through to :func:`read`, see docstring for further details.

        Parameters
        ----------
        **kwargs : optional
            Additional options for :func:`read`

        Examples
        --------
        Generate an example parquet file:

        >>> import pyarrow as pa
        >>> import pandas as pd
        >>> df = pd.DataFrame({'year': [2020, 2022, 2021, 2022, 2019, 2021],
        ...                    'n_legs': [2, 2, 4, 4, 5, 100],
        ...                    'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                    "Brittle stars", "Centipede"]})
        >>> table = pa.Table.from_pandas(df)
        >>> import pyarrow.parquet as pq
        >>> pq.write_table(table, 'table_V2.parquet')
        >>> dataset = pq.ParquetDataset('table_V2.parquet')

        Read the dataset with pandas metadata:

        >>> dataset.read_pandas(columns=["n_legs"])
        pyarrow.Table
        n_legs: int64
        ----
        n_legs: [[2,2,4,4,5,100]]

        >>> dataset.read_pandas(columns=["n_legs"]).schema.pandas_metadata
        {'index_columns': [{'kind': 'range', 'name': None, 'start': 0, ...}
        r   TrG   )r   )rl   rx   s     r$   read_pandaszParquetDataset.read_pandas  s"    H ty<<T<V<<<r&   c                 N    t          | j                                                  S )ad  
        A list of the Dataset source fragments or pieces with absolute
        file paths.

        Examples
        --------
        Generate an example dataset:

        >>> import pyarrow as pa
        >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
        ...                   'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_to_dataset(table, root_path='dataset_v2_fragments',
        ...                     partition_cols=['year'])
        >>> dataset = pq.ParquetDataset('dataset_v2_fragments/')

        List the fragments:

        >>> dataset.fragments
        [<pyarrow.dataset.ParquetFileFragment path=dataset_v2_fragments/...
        )r2   r3  get_fragmentsrp   s    r$   	fragmentszParquetDataset.fragments
  s     2 DM//11222r&   c                     | j         j        S )a+  
        A list of absolute Parquet file paths in the Dataset source.

        Examples
        --------
        Generate an example dataset:

        >>> import pyarrow as pa
        >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
        ...                   'n_legs': [2, 2, 4, 4, 5, 100],
        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
        ...                              "Brittle stars", "Centipede"]})
        >>> import pyarrow.parquet as pq
        >>> pq.write_to_dataset(table, root_path='dataset_v2_files',
        ...                     partition_cols=['year'])
        >>> dataset = pq.ParquetDataset('dataset_v2_files/')

        List the files:

        >>> dataset.files
        ['dataset_v2_files/year=2019/...-0.parquet', ...
        )r3  r=  rp   s    r$   r=  zParquetDataset.files%  s    0 }""r&   c                     | j         j        S )z<
        The filesystem type of the Dataset source.
        )r3  r`   rp   s    r$   r`   zParquetDataset.filesystem?  s    
 }''r&   c                     | j         j        S )zH
        The partitioning of the Dataset source, if discovered.
        )r3  r   rp   s    r$   r   zParquetDataset.partitioningF  s    
 }))r&   NNr   )r   r   r   rC   _read_docstring_common_DNF_filter_doc_parquet_dataset_exampler   rn   r  rB  r   r   r   rG  rV  rY  r=  r`   r   rG   r&   r$   r  r    s\       :t F!?4LMMu x[Dt!%%T$dt-1'+d-1,1[D [D [D [D [Dz+ + +" " " $ $ X$6N N N N`  $$= $= $=L 3 3 X34 # # X#2 ( ( X( * * X* * *r&   r  a(  
{0}

Parameters
----------
source : str, pyarrow.NativeFile, or file-like object
    If a string passed, can be a single file name or directory name. For
    file-like objects, only read a single file. Use pyarrow.BufferReader to
    read a file contained in a bytes or buffer-like object.
columns : list
    If not None, only these columns will be read from the file. A column
    name may be a prefix of a nested field, e.g. 'a' will select 'a.b',
    'a.c', and 'a.d.e'. If empty, no columns will be read. Note
    that the table will still have the correct num_rows set despite having
    no columns.
use_threads : bool, default True
    Perform multi-threaded column reads.
schema : Schema, optional
    Optionally provide the Schema for the parquet dataset, in which case it
    will not be inferred from the source.
{1}
filesystem : FileSystem, default None
    If nothing passed, will be inferred based on path.
    Path will try to be found in the local on-disk filesystem otherwise
    it will be parsed as an URI to determine the filesystem.
filters : pyarrow.compute.Expression or List[Tuple] or List[List[Tuple]], default None
    Rows which do not match the filter predicate will be removed from scanned
    data. Partition keys embedded in a nested directory structure will be
    exploited to avoid loading files at all if they contain no matching rows.
    Within-file level filtering and different partitioning schemes are supported.

    {3}
ignore_prefixes : list, optional
    Files matching any of these prefixes will be ignored by the
    discovery process.
    This is matched to the basename of a path.
    By default this is ['.', '_'].
    Note that discovery happens only if a directory is passed as source.
pre_buffer : bool, default True
    Coalesce and issue file reads in parallel to improve performance on
    high-latency filesystems (e.g. S3). If True, Arrow will use a
    background I/O thread pool. If using a filesystem layer that itself
    performs readahead (e.g. fsspec's S3FS), disable readahead for best
    results.
coerce_int96_timestamp_unit : str, default None
    Cast timestamps that are stored in INT96 format to a particular
    resolution (e.g. 'ms'). Setting to None is equivalent to 'ns'
    and therefore INT96 timestamps will be inferred as timestamps
    in nanoseconds.
decryption_properties : FileDecryptionProperties or None
    File-level decryption properties.
    The decryption properties can be created using
    ``CryptoFactory.file_decryption_properties()``.
thrift_string_size_limit : int, default None
    If not None, override the maximum total string size allocated
    when decoding Thrift structures. The default limit should be
    sufficient for most Parquet files.
thrift_container_size_limit : int, default None
    If not None, override the maximum total size of containers allocated
    when decoding Thrift structures. The default limit should be
    sufficient for most Parquet files.
page_checksum_verification : bool, default False
    If True, verify the checksum for each page read from the file.

Returns
-------
{2}

{4}
ad  
Examples
--------

Generate an example PyArrow Table and write it to a partitioned dataset:

>>> import pyarrow as pa
>>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
...                   'n_legs': [2, 2, 4, 4, 5, 100],
...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
...                              "Brittle stars", "Centipede"]})
>>> import pyarrow.parquet as pq
>>> pq.write_to_dataset(table, root_path='dataset_name_2',
...                     partition_cols=['year'])

Read the data:

>>> pq.read_table('dataset_name_2').to_pandas()
   n_legs         animal  year
0       5  Brittle stars  2019
1       2       Flamingo  2020
2       4            Dog  2021
3     100      Centipede  2021
4       2         Parrot  2022
5       4          Horse  2022


Read only a subset of columns:

>>> pq.read_table('dataset_name_2', columns=["n_legs", "animal"])
pyarrow.Table
n_legs: int64
animal: string
----
n_legs: [[5],[2],[4,100],[2,4]]
animal: [["Brittle stars"],["Flamingo"],["Dog","Centipede"],["Parrot","Horse"]]

Read a subset of columns and read one column as DictionaryArray:

>>> pq.read_table('dataset_name_2', columns=["n_legs", "animal"],
...               read_dictionary=["animal"])
pyarrow.Table
n_legs: int64
animal: dictionary<values=string, indices=int32, ordered=0>
----
n_legs: [[5],[2],[4,100],[2,4]]
animal: [  -- dictionary:
["Brittle stars"]  -- indices:
[0],  -- dictionary:
["Flamingo"]  -- indices:
[0],  -- dictionary:
["Dog","Centipede"]  -- indices:
[0,1],  -- dictionary:
["Parrot","Horse"]  -- indices:
[0,1]]

Read the table with filter:

>>> pq.read_table('dataset_name_2', columns=["n_legs", "animal"],
...               filters=[('n_legs','<',4)]).to_pandas()
   n_legs    animal
0       2  Flamingo
1       2    Parrot

Read data from a single Parquet file:

>>> pq.write_table(table, 'example.parquet')
>>> pq.read_table('dataset_name_2').to_pandas()
   n_legs         animal  year
0       5  Brittle stars  2019
1       2       Flamingo  2020
2       4            Dog  2021
3     100      Centipede  2021
4       2         Parrot  2022
5       4          Horse  2022
Fr  )r   r   r   r   rX   rY   rZ   r   r`   r5   r!  r[   r\   r]   r^   r_   ra   c                   	 t          | ||	|||||
|||||||          }n# t          $ r} |
t          d          |dk    rt          d          |t          d          t          | |	          \  }	}|	|	                    |          } t          | |||||||||
  
        }Y nw xY w|                    |||          S )N)r   r`   r   rY   rX   rZ   r5   r!  r[   r\   r]   r^   r_   ra   zWthe 'filters' keyword is not supported when the pyarrow.dataset module is not availabler  z\the 'partitioning' keyword is not supported when the pyarrow.dataset module is not availablezWthe 'schema' argument is not supported when the pyarrow.dataset module is not available)	rX   rY   rZ   r[   r\   r]   r^   r_   ra   )r   r   r   )r  ImportErrorr1   r   rg   rU   r   )rm   r   r   r   r   rX   rY   rZ   r   r`   r5   r!  r[   r\   r]   r^   r_   ra   rJ   r   s                       r$   
read_tablerc    sT   1
 !%!+#+!(C"7%=(C'A
 
 
"  
 
 
 :   6!!:   :   8
KK
D!//55FO!{!(C"7%=(C'A	
 	
 	
-
B <<[,?  A A As   ! BB('B(z Read a Table from Parquet format
zuse_pandas_metadata : bool, default False
    If True and file has custom pandas schema metadata, ensure that
    index columns are also loaded.z=pyarrow.Table
    Content of the file as a table (of columns)c                 "    t          | f|dd|S )NT)r   r   )rc  )rm   r   rx   s      r$   rV  rV  .  s.    T =C  r&   zcRead a Table from Parquet format, also reading DataFrame
index values if known in the file metadataz6**kwargs
    additional options for :func:`read_table`zgpyarrow.Table
    Content of the file as a Table of Columns, including DataFrame
    indexes as columns r   r   r   c                    |                     d|          }|}	 t          || j        fi d|d|d|d|d|d|d|
d	|	d
|d|d|d|d|d|d|d|d|d|d|d|d|d|d||5 }|                    | |           d d d            d S # 1 swxY w Y   d S # t          $ rI t          |          r8	 t          j        t          |                     n# t          j	        $ r Y nw xY w w xY w)N
chunk_sizer`   r   r   r   r   coerce_timestampsdata_page_sizeallow_truncated_timestampsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  )
r   r   r   r  	Exceptionr   rP  remover   error)r   r   r  r   r   r   r   r   ri  rk  rj  r   r`   r   r   r   r   r   r   r   r   r   r   r   r   r   rx   	use_int96r   s                                r$   r  r  @  sj   0 ZZn==N/I"u|  %:   v	
  .~ "2!1 #4"3  .~ ,F+E (K 1:	 #4"3 '<&; !0 #4"3  +D*C!" '<&;#$ "2!1%& +D*C'( *\)* "2!1+, %8$7-. !0/0 *B)A3  	E2 $u^DDD5	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E6     		/%0011118   sT   AB$ 2B
B$ BB$ BB$ $C7>!C C7 C2/C71C22C7a  Generate an example PyArrow Table:

>>> import pyarrow as pa
>>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
...                              "Brittle stars", "Centipede"]})

and write the Table into Parquet file:

>>> import pyarrow.parquet as pq
>>> pq.write_table(table, 'example.parquet')

Defining row group size for the Parquet file:

>>> pq.write_table(table, 'example.parquet', row_group_size=3)

Defining row group compression (default is Snappy):

>>> pq.write_table(table, 'example.parquet', compression='none')

Defining row group compression and encoding per-column:

>>> pq.write_table(table, 'example.parquet',
...                compression={'n_legs': 'snappy', 'animal': 'gzip'},
...                use_dictionary=['n_legs', 'animal'])

Defining column encoding per-column:

>>> pq.write_table(table, 'example.parquet',
...                column_encoding={'animal':'PLAIN'},
...                use_dictionary=False)
ap  
Write a Table to Parquet format.

Parameters
----------
table : pyarrow.Table
where : string or pyarrow.NativeFile
row_group_size : int
    Maximum number of rows in each written row group. If None, the
    row group size will be the minimum of the Table size and
    1024 * 1024.
{}
**kwargs : optional
    Additional options for ParquetWriter

Examples
--------
{}
c
                    |
                     dd          d}|%|#t          |                    dd                    %|#t          |                    dd                    ddlm} t                      }t          j        |j                  j	        D ]}||
v r|
                     |          ||<   |
                     d|
                     d	d                    |d
<   fd}|
                                } |j        di |
}|t          |          }|r1|                     |          j        }|                    |d          }|t!                      dz   }|	d}	 |j        | |f|||||||||	d	| dS )a%  Wrapper around dataset.write_dataset for writing a Table to
    Parquet format by partitions.
    For each combination of partition columns and values,
    a subdirectories are created in the following
    manner:

    root_dir/
      group1=value1
        group2=value1
          <uuid>.parquet
        group2=value2
          <uuid>.parquet
      group1=valueN
        group2=value1
          <uuid>.parquet
        group2=valueN
          <uuid>.parquet

    Parameters
    ----------
    table : pyarrow.Table
    root_path : str, pathlib.Path
        The root directory of the dataset.
    partition_cols : list,
        Column names by which to partition the dataset.
        Columns are partitioned in the order they are given.
    filesystem : FileSystem, default None
        If nothing passed, will be inferred based on path.
        Path will try to be found in the local on-disk filesystem otherwise
        it will be parsed as an URI to determine the filesystem.
    schema : Schema, optional
        This Schema of the dataset.
    partitioning : Partitioning or list[str], optional
        The partitioning scheme specified with the
        ``pyarrow.dataset.partitioning()`` function or a list of field names.
        When providing a list of field names, you can use
        ``partitioning_flavor`` to drive which partitioning type should be
        used.
    basename_template : str, optional
        A template string used to generate basenames of written data files.
        The token '{i}' will be replaced with an automatically incremented
        integer. If not specified, it defaults to "guid-{i}.parquet".
    use_threads : bool, default True
        Write files in parallel. If enabled, then maximum parallelism will be
        used determined by the number of available CPU cores.
    file_visitor : function
        If set, this function will be called with a WrittenFile instance
        for each file created during the call.  This object will have both
        a path attribute and a metadata attribute.

        The path attribute will be a string containing the path to
        the created file.

        The metadata attribute will be the parquet metadata of the file.
        This metadata will have the file path attribute set and can be used
        to build a _metadata file.  The metadata attribute will be None if
        the format is not parquet.

        Example visitor which simple collects the filenames created::

            visited_paths = []

            def file_visitor(written_file):
                visited_paths.append(written_file.path)

    existing_data_behavior : 'overwrite_or_ignore' | 'error' | 'delete_matching'
        Controls how the dataset will handle data that already exists in
        the destination. The default behaviour is 'overwrite_or_ignore'.

        'overwrite_or_ignore' will ignore any existing data and will
        overwrite files with the same name as an output file.  Other
        existing files will be ignored.  This behavior, in combination
        with a unique basename_template for each write, will allow for
        an append workflow.

        'error' will raise an error if any data exists in the destination.

        'delete_matching' is useful when you are writing a partitioned
        dataset.  The first time each partition directory is encountered
        the entire directory will be deleted.  This allows you to overwrite
        old partitions completely.
    **kwargs : dict,
        Used as additional kwargs for :func:`pyarrow.dataset.write_dataset`
        function for matching kwargs, and remainder to
        :func:`pyarrow.dataset.ParquetFileFormat.make_write_options`.
        See the docstring of :func:`write_table` and
        :func:`pyarrow.dataset.write_dataset` for the available options.
        Using `metadata_collector` in kwargs allows one to collect the
        file metadata instances of dataset pieces. The file paths in the
        ColumnChunkMetaData will be set relative to `root_path`.

    Examples
    --------
    Generate an example PyArrow Table:

    >>> import pyarrow as pa
    >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
    ...                   'n_legs': [2, 2, 4, 4, 5, 100],
    ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
    ...                              "Brittle stars", "Centipede"]})

    and write it to a partitioned dataset:

    >>> import pyarrow.parquet as pq
    >>> pq.write_to_dataset(table, root_path='dataset_name_3',
    ...                     partition_cols=['year'])
    >>> pq.ParquetDataset('dataset_name_3').files
    ['dataset_name_3/year=2019/...-0.parquet', ...

    Write a single Parquet file into the root folder:

    >>> pq.write_to_dataset(table, root_path='dataset_name_4')
    >>> pq.ParquetDataset('dataset_name_4/').files
    ['dataset_name_4/...-0.parquet']
    r   Nz<The '{1}' argument is not supported. Use only '{0}' instead.r   partition_colsfile_visitorr   r  rh  max_rows_per_groupc                 <                         | j                   d S r.   )rL   rV   )written_filer   s    r$   rr  z&write_to_dataset.<locals>.file_visitorK  s     %%l&;<<<<<r&   r  )r   z-{i}.parquetoverwrite_or_ignore)	r`   rC   file_optionsr   r   r   rr  basename_templateexisting_data_behaviorrG   )r   r1   rC   rI   rJ   r   inspect	signaturewrite_dataset
parametersr/  make_write_optionsr   selectr   r   r   )r   	root_pathrq  r`   r   r   rx  r   rr  ry  rx   	msg_conflrD   write_dataset_kwargsr   r:  write_optionspart_schemar   s                     @r$   write_to_datasetr    s%   r  $8$??	"  !l&>)).*:< < = = 	= %,*B)).*>@ @ A A 	A !       66 !122= 8 8&==(.

3 %17&**\4882 2-. %	= 	= 	= 	= 	= ))++N5N5????M '
33
 Cll>229{6BB  FF^3%!6By %/M&!{!+5          Fr&   c                    t          ||          \  }}t          |d          r|                                }t          || |fi |}|                                 |t          ||          }t          |d          r|                    |           |D ]}|                    |           |E|                    |          5 }	|	                    |	           ddd           dS # 1 swxY w Y   dS |	                    |           dS dS )a&  
    Write metadata-only Parquet file from schema. This can be used with
    `write_to_dataset` to generate `_common_metadata` and `_metadata` sidecar
    files.

    Parameters
    ----------
    schema : pyarrow.Schema
    where : string or pyarrow.NativeFile
    metadata_collector : list
        where to collect metadata information.
    filesystem : FileSystem, default None
        If nothing passed, will be inferred from `where` if path-like, else
        `where` is already a file-like object so no filesystem is needed.
    **kwargs : dict,
        Additional kwargs for ParquetWriter class. See docstring for
        `ParquetWriter` for more information.

    Examples
    --------
    Generate example data:

    >>> import pyarrow as pa
    >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
    ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
    ...                              "Brittle stars", "Centipede"]})

    Write a dataset and collect metadata information.

    >>> metadata_collector = []
    >>> import pyarrow.parquet as pq
    >>> pq.write_to_dataset(
    ...     table, 'dataset_metadata',
    ...      metadata_collector=metadata_collector)

    Write the `_common_metadata` parquet file without row groups statistics.

    >>> pq.write_metadata(
    ...     table.schema, 'dataset_metadata/_common_metadata')

    Write the `_metadata` parquet file with row groups statistics.

    >>> pq.write_metadata(
    ...     table.schema, 'dataset_metadata/_metadata',
    ...     metadata_collector=metadata_collector)
    seekNrO  )
r   r*  tellr   ru   rR  r  append_row_groupsr   write_metadata_file)
r   r   r   r`   rx   cursor_positionr   rV   mr+   s
             r$   write_metadatar  k  su   ` 5UJGGJuf '**,,5&*????F
LLNNN% !:>>>5&!! 	(JJ'''# 	* 	*A&&q))))!..u55 0,,Q///0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ((///// &%s   C''C+.C+c                     t          | |          \  }} t                      }||                    |           x}} |5  t          | ||          }|j        cddd           S # 1 swxY w Y   dS )a  
    Read FileMetaData from footer of a single Parquet file.

    Parameters
    ----------
    where : str (file path) or file-like object
    memory_map : bool, default False
        Create memory map when the source is a file path.
    decryption_properties : FileDecryptionProperties, default None
        Decryption properties for reading encrypted Parquet files.
    filesystem : FileSystem, default None
        If nothing passed, will be inferred based on path.
        Path will try to be found in the local on-disk filesystem otherwise
        it will be parsed as an URI to determine the filesystem.

    Returns
    -------
    metadata : FileMetaData
        The metadata of the Parquet file

    Examples
    --------
    >>> import pyarrow as pa
    >>> import pyarrow.parquet as pq
    >>> table = pa.table({'n_legs': [4, 5, 100],
    ...                   'animal': ["Dog", "Brittle stars", "Centipede"]})
    >>> pq.write_table(table, 'example.parquet')

    >>> pq.read_metadata('example.parquet')
    <pyarrow._parquet.FileMetaData object at ...>
      created_by: parquet-cpp-arrow version ...
      num_columns: 2
      num_rows: 3
      num_row_groups: 1
      format_version: 2.6
      serialized_size: ...
    NrY   r]   )r   r   rg   rU   rV   r   rY   r]   r`   file_ctxfiles         r$   rR  rR    s    N 5UJGGJ}}H%55e<<<5	  5Z1FH H H}                 s   A##A'*A'c                    t          | |          \  }} t                      }||                    |           x}} |5  t          | ||          }|j                                        cddd           S # 1 swxY w Y   dS )a  
    Read effective Arrow schema from Parquet file metadata.

    Parameters
    ----------
    where : str (file path) or file-like object
    memory_map : bool, default False
        Create memory map when the source is a file path.
    decryption_properties : FileDecryptionProperties, default None
        Decryption properties for reading encrypted Parquet files.
    filesystem : FileSystem, default None
        If nothing passed, will be inferred based on path.
        Path will try to be found in the local on-disk filesystem otherwise
        it will be parsed as an URI to determine the filesystem.

    Returns
    -------
    schema : pyarrow.Schema
        The schema of the Parquet file

    Examples
    --------
    >>> import pyarrow as pa
    >>> import pyarrow.parquet as pq
    >>> table = pa.table({'n_legs': [4, 5, 100],
    ...                   'animal': ["Dog", "Brittle stars", "Centipede"]})
    >>> pq.write_table(table, 'example.parquet')

    >>> pq.read_schema('example.parquet')
    n_legs: int64
    animal: string
    Nr  )r   r   rg   rU   r   to_arrow_schemar  s         r$   read_schemar    s    D 5UJGGJ}}H%55e<<<5	 - -j"79 9 9 {**,,	- - - - - - - - - - - - - - - - - -s   +A55A9<A9)r   r   r   r   r	   r  rU   r   r   r   r   r
   r   r   rR  rV  r  rc  r  r  r  rS   rR   )Tr.   )Nr   Tr   TNNFNNNNFNr   TNNNTFFNF)NNNNNNNNr]  )FNN)Jcollectionsr   
contextlibr   	functoolsr   rz  r  rP  rerM   pyarrowr   pyarrow._parquetr   rb  excr    r   r   r	   r
   r   r   r   r   r   r   r   
pyarrow.fsr   r   r   r   r   pyarrow.utilr   r   r   r   r%   r:   r_  rR   DeprecationWarningrS   rU   compiler   r   r   r   r  r  r   r   EXCLUDED_PARQUET_PATHSr^  r`  r  _read_table_docstring_read_table_examplerc  rC   r   r   rV  r  _write_table_exampler  r  rR  r  __all__rG   r&   r$   <module>r     sa  & $ # # # # # " " " " " "         				 				     '''''''   
+	4(+C	4 	4 	4  - - - - - - - - - - - - - - - - - - - - - - - - - -J J J J J J J J J J J J J J M M M M M M M M M M M M     6&R@5 @5 @5F (58%79 9 a a a a a a a aH %"*%566 2 2 2  0  ^ @0 fC? C? C? C? C? C? C? C?L  
 % E .# LO* O* O* O* O* O* O* O*dE NL ^ #'DtQVdD%)D+/*/=A =A =A =A =A@ +11*II &'=? @ @3(* *
     ,221II%12 3 3 R	 	  <A19!%04"&+0,0"&&+ $"'*.&*!%*.!!&$) $).)< < < <~  D$ F#%9::%  * 7;@D9=?Cr r r rjE0 E0 E0 E0P BF!/ / / /d @D+- +- +- +-\s   3 AAA