You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Gert Hulselmans (Jira)" <ji...@apache.org> on 2022/12/09 11:02:00 UTC

[jira] [Commented] (ARROW-10344) [Python] Get all columns names (or schema) from Feather file, before loading whole Feather file

    [ https://issues.apache.org/jira/browse/ARROW-10344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17645241#comment-17645241 ] 

Gert Hulselmans commented on ARROW-10344:
-----------------------------------------

[~jorisvandenbossche] Will it ever be possible to get the schema for a Feather v1 file in pyarrow without needing to load the Feather file first?
{code:python}
import pyarrow.feather as pf

# E.g. a schema option for FeatherDataset.
pf.FeatherDataset(["test.v1feather]).schema
{code}

> [Python]  Get all columns names (or schema) from Feather file, before loading whole Feather file
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-10344
>                 URL: https://issues.apache.org/jira/browse/ARROW-10344
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>    Affects Versions: 1.0.1
>            Reporter: Gert Hulselmans
>            Priority: Major
>
> Is there a way to get all column names (or schema) from a Feather file before loading the full Feather file?
> My Feather files are big (like 100GB) and the names of the columns are different per analysis and can't be hard coded.
> {code:python}
> import pyarrow.feather as feather
> # Code here to check which columns are in the feather file.
> ...
> my_columns = ...
> # Result is pandas.DataFrame
> read_df = feather.read_feather('/path/to/file', columns=my_columns)
> # Result is pyarrow.Table
> read_arrow = feather.read_table('/path/to/file', columns=my_columns)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)