§
    #P„j:1  ã                   óÂ   — d dl mZ d dlZd dlmZ d dlmZ d dlmZ  G d„ d¦  «        Z	dZ
 G d„ d	¦  «        Zdd
„Zde_        ddddddddddddœd„Zde
› d�e_        dS )é    )ÚIntegralN)ÚTable)Ú_resolve_filesystem_and_pathc                   ó¦  — e Zd ZdZd„ Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Z	ed„ ¦   «         Z
ed„ ¦   «         Zed	„ ¦   «         Zed
„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zdd„Zdd„Zdd„ZdS )ÚORCFilea  
    Reader interface for a single ORC file

    Parameters
    ----------
    source : str or pyarrow.NativeFile
        Readable source. For passing Python file objects or byte buffers,
        see pyarrow.io.PythonFileInterface or pyarrow.io.BufferReader.
    c                 ój   — t          j        ¦   «         | _        | j                             |¦  «         d S ©N)Ú_orcÚ	ORCReaderÚreaderÚopen)ÚselfÚsources     úP/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/pyarrow/orc.pyÚ__init__zORCFile.__init__&   s-   € Ý”nÑ&Ô&ˆŒØŒ×Ò˜Ñ Ô Ð Ð Ð ó    c                 ó4   — | j                              ¦   «         S )z/The file metadata, as an arrow KeyValueMetadata)r   Úmetadata©r   s    r   r   zORCFile.metadata*   ó   € ð Œ{×#Ò#Ñ%Ô%Ð%r   c                 ó4   — | j                              ¦   «         S )z#The file schema, as an arrow schema)r   Úschemar   s    r   r   zORCFile.schema/   s   € ð Œ{×!Ò!Ñ#Ô#Ð#r   c                 ó4   — | j                              ¦   «         S )zThe number of rows in the file)r   Únrowsr   s    r   r   zORCFile.nrows4   s   € ð Œ{× Ò Ñ"Ô"Ð"r   c                 ó4   — | j                              ¦   «         S )z!The number of stripes in the file)r   Únstripesr   s    r   r   zORCFile.nstripes9   r   r   c                 ó4   — | j                              ¦   «         S )z4Format version of the ORC file, must be 0.11 or 0.12)r   Úfile_versionr   s    r   r   zORCFile.file_version>   s   € ð Œ{×'Ò'Ñ)Ô)Ð)r   c                 ó4   — | j                              ¦   «         S )z2Software instance and version that wrote this file)r   Úsoftware_versionr   s    r   r    zORCFile.software_versionC   ó   € ð Œ{×+Ò+Ñ-Ô-Ð-r   c                 ó4   — | j                              ¦   «         S )zCompression codec of the file)r   Úcompressionr   s    r   r#   zORCFile.compressionH   ó   € ð Œ{×&Ò&Ñ(Ô(Ð(r   c                 ó4   — | j                              ¦   «         S )z?Number of bytes to buffer for the compression codec in the file)r   Úcompression_sizer   s    r   r&   zORCFile.compression_sizeM   r!   r   c                 ó4   — | j                              ¦   «         S )z{Name of the writer that wrote this file.
        If the writer is unknown then its Writer ID
        (a number) is returned)r   Úwriterr   s    r   r(   zORCFile.writerR   s   € ð
 Œ{×!Ò!Ñ#Ô#Ð#r   c                 ó4   — | j                              ¦   «         S )zVersion of the writer)r   Úwriter_versionr   s    r   r*   zORCFile.writer_versionY   ó   € ð Œ{×)Ò)Ñ+Ô+Ð+r   c                 ó4   — | j                              ¦   «         S )zRNumber of rows per an entry in the row index or 0
        if there is no row index)r   Úrow_index_strider   s    r   r-   zORCFile.row_index_stride^   s   € ð Œ{×+Ò+Ñ-Ô-Ð-r   c                 ó4   — | j                              ¦   «         S )zNumber of stripe statistics)r   Únstripe_statisticsr   s    r   r/   zORCFile.nstripe_statisticsd   ó   € ð Œ{×-Ò-Ñ/Ô/Ð/r   c                 ó4   — | j                              ¦   «         S )z/Length of the data stripes in the file in bytes)r   Úcontent_lengthr   s    r   r2   zORCFile.content_lengthi   r+   r   c                 ó4   — | j                              ¦   «         S )z<The number of compressed bytes in the file stripe statistics)r   Ústripe_statistics_lengthr   s    r   r4   z ORCFile.stripe_statistics_lengthn   s   € ð Œ{×3Ò3Ñ5Ô5Ð5r   c                 ó4   — | j                              ¦   «         S )z1The number of compressed bytes in the file footer)r   Úfile_footer_lengthr   s    r   r6   zORCFile.file_footer_lengths   r0   r   c                 ó4   — | j                              ¦   «         S )z*The number of bytes in the file postscript)r   Úfile_postscript_lengthr   s    r   r8   zORCFile.file_postscript_lengthx   s   € ð Œ{×1Ò1Ñ3Ô3Ð3r   c                 ó4   — | j                              ¦   «         S )zThe number of bytes in the file)r   Úfile_lengthr   s    r   r:   zORCFile.file_length}   r$   r   Nc                 ó:  — |€d S | j         }g }|D ]Š}t          |t          ¦  «        rpt          |¦  «        }d|cxk    rt	          |¦  «        k     r&n n#||         j        }|                     |¦  «         Œft          dt	          |¦  «        |fz  ¦  «        ‚|c S |S )Nr   z/Column indices must be in 0 <= ind < %d, got %d)r   Ú
isinstancer   ÚintÚlenÚnameÚappendÚ
ValueError)r   Úcolumnsr   ÚnamesÚcols        r   Ú_select_nameszORCFile._select_names‚   sË   € Øˆ?Ø�4à”ˆØˆØð 
	ð 
	ˆCÝ˜#�xÑ(Ô(ð 	Ý˜#‘h”h�Ø˜Ð)Ð)Ò)Ð)�c &™kœkÒ)Ð)Ð)Ð)Ð)Ø  œ+Ô*�CØ—L’L Ñ%Ô%Ð%Ð%å$ð &/Ý25°f±+´+¸sÐ1Cñ&Dñ Eô Eð Eð ���àˆr   c                 ód   — |                       |¦  «        }| j                             ||¬¦  «        S )aÊ  Read a single stripe from the file.

        Parameters
        ----------
        n : int
            The stripe index
        columns : list
            If not None, only these columns will be read from the stripe. A
            column name may be a prefix of a nested field, e.g. 'a' will select
            'a.b', 'a.c', and 'a.d.e'

        Returns
        -------
        pyarrow.RecordBatch
            Content of the stripe as a RecordBatch.
        ©rB   )rE   r   Úread_stripe)r   ÚnrB   s      r   rH   zORCFile.read_stripe–   s2   € ð" ×$Ò$ WÑ-Ô-ˆØŒ{×&Ò& q°'Ð&Ñ:Ô:Ð:r   c                 ób   — |                       |¦  «        }| j                             |¬¦  «        S )aÖ  Read the whole file.

        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'. Output always follows the
            ordering of the file and not the `columns` list.

        Returns
        -------
        pyarrow.Table
            Content of the file as a Table.
        rG   )rE   r   Úread)r   rB   s     r   rK   zORCFile.readª   s0   € ð  ×$Ò$ WÑ-Ô-ˆØŒ{×Ò¨ÐÑ0Ô0Ð0r   r	   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r   r   r   r   r    r#   r&   r(   r*   r-   r/   r2   r4   r6   r8   r:   rE   rH   rK   © r   r   r   r      s4  € € € € € ðð ð!ð !ð !ð ð&ð &ñ „Xð&ð ð$ð $ñ „Xð$ð ð#ð #ñ „Xð#ð ð&ð &ñ „Xð&ð ð*ð *ñ „Xð*ð ð.ð .ñ „Xð.ð ð)ð )ñ „Xð)ð ð.ð .ñ „Xð.ð ð$ð $ñ „Xð$ð ð,ð ,ñ „Xð,ð ð.ð .ñ „Xð.ð
 ð0ð 0ñ „Xð0ð ð,ð ,ñ „Xð,ð ð6ð 6ñ „Xð6ð ð0ð 0ñ „Xð0ð ð4ð 4ñ „Xð4ð ð)ð )ñ „Xð)ðð ð ð ð(;ð ;ð ;ð ;ð(1ð 1ð 1ð 1ð 1ð 1r   r   a©  file_version : {"0.11", "0.12"}, default "0.12"
    Determine which ORC file version to use.
    `Hive 0.11 / ORC v0 <https://orc.apache.org/specification/ORCv0/>`_
    is the older version
    while `Hive 0.12 / ORC v1 <https://orc.apache.org/specification/ORCv1/>`_
    is the newer one.
batch_size : int, default 1024
    Number of rows the ORC writer writes at a time.
stripe_size : int, default 64 * 1024 * 1024
    Size of each ORC stripe in bytes.
compression : string, default 'uncompressed'
    The compression codec.
    Valid values: {'UNCOMPRESSED', 'SNAPPY', 'ZLIB', 'LZ4', 'ZSTD'}
    Note that LZ0 is currently not supported.
compression_block_size : int, default 64 * 1024
    Size of each compression block in bytes.
compression_strategy : string, default 'speed'
    The compression strategy i.e. speed vs size reduction.
    Valid values: {'SPEED', 'COMPRESSION'}
row_index_stride : int, default 10000
    The row index stride i.e. the number of rows per
    an entry in the row index.
padding_tolerance : double, default 0.0
    The padding tolerance.
dictionary_key_size_threshold : double, default 0.0
    The dictionary key size threshold. 0 to disable dictionary encoding.
    1 to always enable dictionary encoding.
bloom_filter_columns : None, set-like or list-like, default None
    Columns that use the bloom filter.
bloom_filter_fpp : double, default 0.05
    Upper limit of the false-positive rate of the bloom filter.
c                   ó\   — e Zd Zde› d�ZdZdddddd	d
dddddœd„Zd„ Zd„ Zd„ Z	d„ Z
d„ ZdS )Ú	ORCWritera  
Writer interface for a single ORC file

Parameters
----------
where : str or pyarrow.io.NativeFile
    Writable target. For passing Python file objects or byte buffers,
    see pyarrow.io.PythonFileInterface, pyarrow.io.BufferOutputStream
    or pyarrow.io.FixedSizeBufferWriter.
ú
Fú0.12é   é   Úuncompressedé   Úspeedé'  ç        Nçš™™™™™©?©r   Ú
batch_sizeÚstripe_sizer#   Úcompression_block_sizeÚcompression_strategyr-   Úpadding_toleranceÚdictionary_key_size_thresholdÚbloom_filter_columnsÚbloom_filter_fppc                ó�   — t          j        ¦   «         | _        | j                             |||||||||	|
||¬¦  «         d| _        d S )Nr^   T)r
   rS   r(   r   Úis_open)r   Úwherer   r_   r`   r#   ra   rb   r-   rc   rd   re   rf   s                r   r   zORCWriter.__init__ï   sc   € õ ”nÑ&Ô&ˆŒØŒ×ÒØØ%Ø!Ø#Ø#Ø#9Ø!5Ø-Ø/Ø*GØ!5Ø-ð 	ñ 	
ô 	
ð 	
ð ˆŒˆˆr   c                 ó.   — |                       ¦   «          d S r	   ©Úcloser   s    r   Ú__del__zORCWriter.__del__  ó   € Ø�
Š
‰Œˆˆˆr   c                 ó   — | S r	   rQ   r   s    r   Ú	__enter__zORCWriter.__enter__  s   € Øˆr   c                 ó.   — |                       ¦   «          d S r	   rk   )r   ÚargsÚkwargss      r   Ú__exit__zORCWriter.__exit__  rn   r   c                 óL   — | j         sJ ‚| j                             |¦  «         dS )a
  
        Write the table into an ORC file. The schema of the table must
        be equal to the schema used when opening the ORC file.

        Parameters
        ----------
        table : pyarrow.Table
            The table to be written into the ORC file
        N)rh   r(   Úwrite)r   Útables     r   rv   zORCWriter.write  s-   € ð Œ|ÐÐˆ|ØŒ×Ò˜%Ñ Ô Ð Ð Ð r   c                 óX   — | j         r"| j                             ¦   «          d| _         dS dS )z$
        Close the ORC file
        FN)rh   r(   rl   r   s    r   rl   zORCWriter.close#  s7   € ð Œ<ð 	!ØŒK×ÒÑÔÐØ ˆDŒLˆLˆLð	!ð 	!r   )rL   rM   rN   Ú_orc_writer_args_docsrO   rh   r   rm   rp   rt   rv   rl   rQ   r   r   rS   rS   à   s½   € € € € € ð
ð ð
ð 
ð 
€Gð €Gð %Ø Ø-Ø+Ø(-Ø&-Ø"'Ø#&Ø/2Ø&*Ø"&ðð ð ð ð ð<ð ð ðð ð ðð ð ð!ð !ð !ð!ð !ð !ð !ð !r   rS   c                 ó4  — t          | |¦  «        \  }}|�|                     |¦  «        } |�Ht          |¦  «        dk    r5t          | ¦  «                             ¦   «                              |¦  «        }n#t          | ¦  «                             |¬¦  «        }|S )Nr   rG   )r   Úopen_input_filer>   r   rK   Úselect)r   rB   Ú
filesystemÚpathÚresults        r   Ú
read_tabler€   ,  s�   € Ý3°F¸JÑGÔGÑ€J�ØÐØ×+Ò+¨DÑ1Ô1ˆàÐ�s 7™|œ|¨qÒ0Ð0Ý˜‘”×%Ò%Ñ'Ô'×.Ò.¨wÑ7Ô7ˆˆå˜‘”×%Ò%¨gÐ%Ñ6Ô6ˆà€Mr   a˜  
Read a Table from an ORC file.

Parameters
----------
source : str, pyarrow.NativeFile, or file-like object
    If a string passed, can be a single file 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'. Output always follows the ordering of the file and
    not the `columns` list. If empty, no columns will be read. Note
    that the table will still have the correct num_rows set despite having
    no columns.
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.
rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   c                ó  — t          |t          ¦  «        r t          j        dt          d¬¦  «         || }} t          |||||||||	|
||¬¦  «        5 }|                     | ¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )Nz…The order of the arguments has changed. Pass as 'write_table(table, where)' instead. The old order will raise an error in the future.é   )Ú
stacklevelr^   )r<   r   ÚwarningsÚwarnÚFutureWarningrS   rv   )rw   ri   r   r_   r`   r#   ra   rb   r-   rc   rd   re   rf   r(   s                 r   Úwrite_tabler‡   P  só   € õ �%�ÑÔð $ÝŒð&å'4Àð	
ñ 	
ô 	
ð 	
ð
 ˜eˆuˆÝ	ØØ!ØØØØ5Ø1Ø)Ø+Ø&CØ1Ø)ð
ñ 
ô 
ð ð 
Ø�Š�UÑÔÐðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   ÁA4Á4A8Á;A8aZ  
Write a table into an ORC file.

Parameters
----------
table : pyarrow.lib.Table
    The table to be written into the ORC file
where : str or pyarrow.io.NativeFile
    Writable target. For passing Python file objects or byte buffers,
    see pyarrow.io.PythonFileInterface, pyarrow.io.BufferOutputStream
    or pyarrow.io.FixedSizeBufferWriter.
rT   )NN)Únumbersr   r„   Úpyarrow.libr   Úpyarrow._orcr
   Ú
pyarrow.fsr   r   ry   rS   r€   rO   r‡   rQ   r   r   ú<module>rŒ      sB  ðð& Ð Ð Ð Ð Ð Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3ð`1ð `1ð `1ð `1ð `1ñ `1ô `1ð `1ðFÐ ðDI!ð I!ð I!ð I!ð I!ñ I!ô I!ð I!ðX
ð 
ð 
ð 
ð€
Ô ð0 $ØØ,Ø*Ø',Ø%,Ø!&Ø"%Ø.1Ø%)Ø!%ð!ð !ð !ð !ð !ðHð ðð ð €Ô Ð Ð r   