Skip to content

ARROW-723: [Python] Ensure that passing chunk_size=0 when writing Parquet file does not enter infinite loop - #468

Closed
wesm wants to merge 2 commits into
apache:masterfrom
wesm:ARROW-723
Closed

wesm wants to merge 2 commits into
apache:masterfrom
wesm:ARROW-723

Conversation

@wesm

@wesm wesm commented Mar 31, 2017

Copy link
Copy Markdown
Member

This should also be fixed in parquet-cpp, will open a JIRA.

…nter infinite loop

Change-Id: I16a9d71002d1160d4cb795e2c4b27c3e6b9a4039
data = pd.DataFrame([np.arange(4)], columns=['A', 'B', 'C', 'D'])
table = pa.Table.from_pandas(data.reset_index())

buf = io.BytesIO()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using -1 to mean min row group size and disallowing 0?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the issue was the user did len(foo) / K and it truncated to zero. We could have it raise an exception instead

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither value makes sense logically, but -1 seems like a more obvious indicator that we're saying "do the default".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. Yeah I think raising an exception is probably the way to go here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chunk_size=None does the default also. I'll raise an exception for 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I saw that as well. I'm just going off intuition here, this shed is fully painted now 👍

Change-Id: I650a13ebcf93f4738ddfc825a2e110f41adee138
@asfgit asfgit closed this in fd00096 Apr 1, 2017
@wesm
wesm deleted the ARROW-723 branch July 29, 2017 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants