-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
arrow::util::pretty::pretty_format_batches missing #769
Comments
Hi @yuribudilov -- you need to enable the "prettyprint" feature for arrow. So instead of arrow = "5.0.0" try using arrow = { version = "5.0", features = ["prettyprint"] } |
thank you. One compilation error is now gone but replaced by another 2 compilation errors, one step forward, two steps back. Repro: on https://github.com/apache/arrow-datafusion there is Rust code sample given (quote), which does not compile: use arrow::record_batch::RecordBatch; #[tokio::main]
} The TOML on the link only shows one line: datafusion = "4.0.0-SNAPSHOT" This TOML does not work because there is no arrow and no tokio dependency in TOML. Here is what I have now, which still does not work: arrow = "5.0.0"datafusion = "4.0.0" I still have 2 compilation errors based on above: 15 | let results: Vec = df.collect().await?; // error 1 error[E0277]: error: aborting due to 2 previous errors First one can be "covered up" by letting Rust infer data type like so (which is very odd given it infers the same Vec ! The second error indicated something is wrong with TOML documentation: Can you please point me to documentation how to use this product from Rust? |
OK, I fixed it, thanks to Rust compiler (what a fantastic language!!) Rust errors "suggested" different version of arrow crate were used. So I tried using an earlier arrow version in TOML: arrow = { version = "4.4.0", features = ["prettyprint", "default"] } This compiles and builds and runs correctly !! Phew! Happy days. May I humbly suggest there is likely to be a buglet in either datafusion 4.0.0 or in arrow 5.0 or both ? May I also suggest to update datafusion documentation to list more complete TOML dependencies because those of us who are new to arrow/datafusion but would like to learn could use more help and reliable and accessible documentation is all we have. Many thanks for reading thus far, it looks like a fantastic product you have been building! |
Yes, this is the version of arrow that the (released) datafusion version 4.0 works with. 👍 The fact that we haven't released a new version of datafusion to crates.io that works with arrow 5 is a problem which we should rectify. DataFusion (at least on master) also includes a "public export" of its arrow dependency, so perhaps we should change the example from use arrow::record_batch::RecordBatch;
use arrow::util::pretty::print_batches; to use datafusion::arrow::record_batch::RecordBatch;
use datafusion::arrow::util::pretty::print_batches;
Thanks! Kudos go to the whole team (there are many people whose work goes into making it) |
I made #772 to try and improve the docs a little bit |
I appreciate your support, wonderful and quick! |
Indeed! I think this is @andygrove 's vision as well. Thanks for the kind words. |
Hello
My apologies for novice Arrow question.
I am not able to compile the code sample due to missing "pretty" function in arrow util.
Using Rust 1.53.0 Stable.
Toml is:
[package]
name = "test_arrow"
version = "0.1.0"
edition = "2018"
[dependencies]
arrow = "5.0.0"
datafusion = "4.0.0"
tokio = "1.8.2"
// compilation can not find this:
use arrow::util::pretty::print_batches;
// also this fails to compile:
let pretty_results = arrow::util::pretty::pretty_format_batches(&results)?;
Error: cannot find 'pretty' in util.
What am I doing wrong please?
thank you very much
The text was updated successfully, but these errors were encountered: