-
Notifications
You must be signed in to change notification settings - Fork 26
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
Edit parquet file #1192
Comments
I was using I will check the code bellow data_frame()
->read(from_parquet(__DIR__ . '/orders_flow.parquet'))
->select('created_at', 'total_price', 'discount')
->withEntry('created_at', ref('created_at')->cast('date')->dateFormat('Y/m'))
->withEntry('revenue', ref('total_price')->minus(ref('discount')))
->select('created_at', 'revenue')
->groupBy('created_at')
->aggregate(sum(ref('revenue')))
->sortBy(ref('created_at')->desc())
->withEntry('daily_revenue', ref('revenue_sum')->round(lit(2))->numberFormat(lit(2)))
->drop('revenue_sum')
->write(to_output(truncate: false))
->withEntry('created_at', ref('created_at')->toDate('Y/m'))
->saveMode(overwrite())
->write(to_parquet(__DIR__ . '/daily_revenue.parquet'))
->run(); in case it didn't work I reopen the issue :) |
hey @eerison
No, parquet files are immutable, they can't be directly edited. Instead, if you want to modify the file, you should read it, modify it on the fly, and save it somewhere else. The saveMode in flow is going to let you overwrite existing file, bot not modify it.
no worries, here is fine, you can also join ourbdiscord server where you can get your answers faster 😊 you can find link on the website header https://flow-php.com |
Hello :)
is it possible to edit the file?
I am writing the file like this
the first execution it works, But if I try to write again into the same file I get the exception bellow:
Flow\Parquet\Exception\InvalidArgumentException: File /app/test.parquet already exists
is it expected?
Note: in case it isn't the correct place to open this issue, could you move to the main repo please.
The text was updated successfully, but these errors were encountered: