Skip to content

Arrow freezes on write if chunk_size=0 #16342

Closed

Description

@asfimport

Pyarrow freezes if you set chunk_size=0 (e.g. if you forget to account for short data when setting chunk size as a function of table length, see example).

Would expect either to handle gracefully (e.g. revert to behaviour chunk_size=None) or to throw error.

import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
cols = 'A', 'B', 'C', 'D'
row = np.arange(4)
data = pd.DataFrame([row], columns=cols)
table = pa.Table.from_pandas(data.reset_index(), timestamps_to_ms=True)
pq.write_table(table, 'test.pq', chunk_size=int(len(data) / 4))

Environment: Linux, macOS
Reporter: Jonathan Chambers
Assignee: Wes McKinney / @wesm

Related issues:

Note: This issue was originally created as ARROW-723. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Mar 28, 2017

    @asfimport
    Author

    Wes McKinney / @wesm:
    Thanks [~mangecoeur] – I marked this for the next Arrow release. If you have time to figure out where the crash is happening and submit a patch, you are more than welcome.

  2. asfimport commented on Mar 31, 2017

    @asfimport
    Author

    Jonathan Chambers:
    I don't have time to explore this much unfortunately, but I can share a few observations:

    • Running on Anaconda Python 3.6 in conda env on macOS 10.12.3
    • When run in an interactive console, this bug completely freezes the process - cannot exit with ctrl-c etc, need to kill the process.
    • When run through Pycharm's interactive debugger, it gets to the write file line and then freezes - no way to continue debugging, forced to kill debugger.
    • A test.pq file is written that seems to increase in size indefinitely if you let the process run.
    • CPU usage is 100%
    • These suggest that pyarrow get's stuck in an infinite loop somewhere in the C part of the code.

    Hope that helps

  3. asfimport commented on Mar 31, 2017

    @asfimport
    Author
  4. asfimport commented on Apr 1, 2017

    @asfimport
    Author

    Wes McKinney / @wesm:
    Issue resolved by pull request 468
    #468

  5. added this to the 0.3.0 milestone on Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions