lidavidm commented on a change in pull request #10658:
URL: https://github.com/apache/arrow/pull/10658#discussion_r664725589
##########
File path: python/setup.py
##########
@@ -108,6 +108,7 @@ def run(self):
'namespace of boost (default: boost)'),
('with-cuda', None, 'build the Cuda extension'),
('with-flight', None, 'build the Flight extension'),
+ ('with-hdfs', None, 'build the HDFS extension'),
Review comment:
Removed (sorry, it bugs me when I have to remember which of env var/CLI
argument to use for each component).
##########
File path: docs/source/python/csv.rst
##########
@@ -64,6 +65,16 @@ with the file path you want to read from::
3 23.68 3.31 Male No Sun Dinner 2
4 24.59 3.61 Female No Sun Dinner 4
+To write CSV files, just call :func:`write_csv` with a
Review comment:
Added a note below (and in the C++ docs too).
##########
File path: docs/source/cpp/csv.rst
##########
@@ -69,6 +69,44 @@ A CSV file is read from a :class:`~arrow::io::InputStream`.
std::shared_ptr<arrow::Table> table = *maybe_table;
}
+A CSV file is written to a :class:`~arrow::io::OutputStream`.
+
+.. code-block:: cpp
+
+ #include <arrow/csv/api.h>
+ {
+ // Oneshot write
+ // ...
+ std::shared_ptr<arrow::io::OutputStream> output = ...;
+ auto write_options = arrow::csv::WriteOptions::Defaults();
+ if (WriteCSV(table, options, output.get()).ok()) {
+ // Handle writer error...
+ }
+ }
+ {
+ // Write incrementally
+ // ...
+ std::shared_ptr<arrow::io::OutputStream> output = ...;
+ auto write_options = arrow::csv::WriteOptions::Defaults();
+ auto maybe_writer = arrow::csv::MakeCSVWriter(output, schema, options);
+ if (!maybe_writer.ok()) {
+ // Handle writer instantiation error...
+ }
+ std::shared_ptr<arrow::ipc::RecordBatchWriter> writer = *maybe_writer;
+
+ // Write batches...
+ if (!writer->WriteRecordBatch(*batch).ok()) {
Review comment:
Looks like we generally don't use the macros, nor do we use ValueOrDie -
it is a bit messy here though, I'll give you that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]