3
���h� � @ sh d Z ddlZddlmZmZmZ ddlmZ ddlm Z erHddl
mZ deeee dd�d d
�Z
dS )z orc compat � N)�
TYPE_CHECKING�List�Optional)�FilePathOrBuffer)�get_filepath_or_buffer)� DataFramer )�path�columns�returnc K sb ddl }tjj|j�dk r"td��ddl}t| �\} }}}|jj | �}|j
f d|i|��j� }|S )az
Load an ORC object from the file path, returning a DataFrame.
.. versionadded:: 1.0.0
Parameters
----------
path : str, path object or file-like object
Any valid string path is acceptable. The string could be a URL. Valid
URL schemes include http, ftp, s3, and file. For file URLs, a host is
expected. A local file could be:
``file://localhost/path/to/table.orc``.
If you want to pass in a path object, pandas accepts any
``os.PathLike``.
By file-like object, we refer to objects with a ``read()`` method,
such as a file handler (e.g. via builtin ``open`` function)
or ``StringIO``.
columns : list, default None
If not None, only these columns will be read from the file.
**kwargs
Any additional kwargs are passed to pyarrow.
Returns
-------
DataFrame
r Nz0.13.0z&pyarrow must be >= 0.13.0 for read_orcr )�pyarrow� distutils�versionZLooseVersion�__version__�ImportErrorZpyarrow.orcr ZorcZORCFile�readZ to_pandas)r r �kwargsr �_Zorc_file�result� r �//tmp/pip-build-5_djhm0z/pandas/pandas/io/orc.py�read_orc s r )N)�__doc__r Ztypingr r r Zpandas._typingr Zpandas.io.commonr Zpandasr �strr r r r r �<module> s |