Skip to content

Empty partitions being written through pyarrow engine #3454

Closed

Description

@dafrimer

It looks like this was resolved for fastparquet in merge #2020 reported in error #2016

Pyarrow writes to empty dataframes in empty parquet files and in turn looks like the dataframe columns that are read are null and hence floats which dont work .

can we apply the fix from the #2020 merge into the pyarrow to_parquet method?

reads the file wrong

`

ValueError Traceback (most recent call last)
in ()
4 import pyarrow.parquet as pq
5
----> 6 pq.ParquetDataset('OccurrenceMatrix.parquet')
7 #dddf = dd.read_parquet(r'./OccurrenceMatrix\YearMonth=2013-01\0923ebd160fb4a4784a5560e6b924269.parquet ',engine = 'pyarrow')
8 #dddf.columns

~\Anaconda\envs\jobsanalysis\lib\site-packages\pyarrow\parquet.py in init(self, path_or_paths, filesystem, schema, metadata, split_row_groups, validate_schema)
743
744 if validate_schema:
--> 745 self.validate_schemas()
746
747 def validate_schemas(self):

~\Anaconda\envs\jobsanalysis\lib\site-packages\pyarrow\parquet.py in validate_schemas(self)
773 '{1!s}\n\nvs\n\n{2!s}'
774 .format(piece, file_schema,
--> 775 dataset_schema))
776
777 def read(self, columns=None, nthreads=1, use_pandas_metadata=False):

ValueError: Schema in OccurrenceMatrix.parquet\part.174.parquet was different.
Id: int64
CompanyId: int64
CompanyName: null
DateBegin: timestamp[us]
FunctionName: null
Title: null
isStaffing: null

vs

Id: int64
CompanyId: int64
CompanyName: string
DateBegin: timestamp[us]
FunctionName: string
Title: string
isStaffing: string
`

Activity

  1. gsakkis commented on Aug 14, 2018

    @gsakkis
    Contributor

    I was bitten by this too. Looking at the related code, it seems it delegates the actual work to pyarrow. apache/arrow#2110 seems related although it was closed without a fix as a known limitation.

  2. xhochy commented on Aug 19, 2018

    @xhochy
    Contributor
  3. mrocklin commented on Oct 24, 2018

    @mrocklin
    Member

    Closing as upstream. Thanks @xhochy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions