/usr/local/lib64/python3.6/site-packages/pyarrow/__pycache__
Edit: /usr/local/lib64/python3.6/site-packages/pyarrow/__pycache__/orc.cpython-36.pyc (5140B)
3
8%Eg• ã @ sR d dl mZ d dlZd dlmZ d dljZG dd„ dƒZG dd„ dƒZdd „ Z dS )
é )ÚIntegralN)ÚTablec @ sf e Zd ZdZdd„ Zedd„ ƒZedd„ ƒZedd „ ƒZed
d„ ƒZ dd
d„Z
ddd„Zddd„ZdS )ÚORCFilea
Reader interface for a single ORC file
Parameters
----------
source : str or pyarrow.io.NativeFile
Readable source. For passing Python file objects or byte buffers,
see pyarrow.io.PythonFileInterface or pyarrow.io.BufferReader.
c C s t jƒ | _| jj|ƒ d S )N)Ú_orcZ ORCReaderÚreaderÚopen)ÚselfÚsource© r
ú7/usr/local/lib64/python3.6/site-packages/pyarrow/orc.pyÚ__init__% s
zORCFile.__init__c C s
| j jƒ S )z/The file metadata, as an arrow KeyValueMetadata)r Úmetadata)r r
r
r r
) s zORCFile.metadatac C s
| j jƒ S )z#The file schema, as an arrow schema)r Úschema)r r
r
r r . s zORCFile.schemac C s
| j jƒ S )zThe number of rows in the file)r Únrows)r r
r
r r 3 s z
ORCFile.nrowsc C s
| j jƒ S )z!The number of stripes in the file)r Únstripes)r r
r
r r 8 s zORCFile.nstripesNc C s† |d krd S | j }g }xj|D ]b}t|tƒrzt|ƒ}d| koHt|ƒk n rd|| j}|j|ƒ q~tdt|ƒ|f ƒ‚q|S qW |S )Nr z/Column indices must be in 0 <= ind < %d, got %d)r Ú
isinstancer ÚintÚlenÚnameÚappendÚ
ValueError)r Úcolumnsr ÚnamesÚcolr
r
r Ú
_select_names= s
zORCFile._select_namesc C s | j |ƒ}| jj||dS )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.lib.RecordBatch
Content of the stripe as a RecordBatch.
)r )r r Úread_stripe)r Únr r
r
r r Q s
zORCFile.read_stripec C s | j |ƒ}| jj|dS )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'
Returns
-------
pyarrow.lib.Table
Content of the file as a Table.
)r )r r Úread)r r r
r
r r e s
zORCFile.read)N)N)N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r Úpropertyr
r r r r r r r
r
r
r r s
r c @ s( e Zd ZdZdd„ Zdd„ Zdd„ ZdS ) Ú ORCWritera9
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.
c C s t jƒ | _| jj|ƒ d S )N)r r# Úwriterr )r Úwherer
r
r r „ s
zORCWriter.__init__c C s | j j|ƒ dS )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
----------
schema : pyarrow.lib.Table
The table to be written into the ORC file
N)r$ Úwrite)r Útabler
r
r r&