Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Allow customization of filename and sharding for dataframe IOs. #22923

Open
robertwb opened this issue Aug 26, 2022 · 3 comments

Comments

@robertwb
Copy link
Contributor

What would you like to happen?

Other sinks, such as TextIO and FileSink, allow this customization.

Issue Priority

Priority: 2

Issue Component

Component: dsl-dataframe

@robertwb
Copy link
Contributor Author

robertwb added a commit to robertwb/incubator-beam that referenced this issue Aug 26, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
This fixes issue apache#22923.
@github-actions github-actions bot added the stale label Oct 26, 2022
@damccorm damccorm removed the stale label Dec 2, 2022
@jzxu
Copy link

jzxu commented Nov 30, 2023

Hi, I noticed that despite #22925 being merged, DeferredDataFrame.to_csv() still doesn't respect the num_shards argument. Minimal test case:

from typing import NamedTuple
import apache_beam as beam
from apache_beam.dataframe import convert

class Row(NamedTuple):
  x: int

with beam.Pipeline('DirectRunner') as p:
  c = (p | beam.Create([Row(x=i) for i in range(1000000)]))
  df = convert.to_dataframe(c)
  df.to_csv('/tmp/apache_beam_test.csv', index=False, num_shards=2)

Running this with apache_beam 2.50.0 results in a single shard being written.

@jconlon
Copy link

jconlon commented Jul 18, 2024

Having same problem with df.to_parquet

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

No branches or pull requests

4 participants