Skip to content

Apache DataFusion SQL Query Engine

Add `cfg(feature = "avro")` attribute to Avro example in SQL API docs (#17142)

kosiew097e893f92cf
diff --git a/docs/source/library-user-guide/using-the-sql-api.md b/docs/source/library-user-guide/using-the-sql-api.md
index f78cf16f4c..8b8ba2a371 100644
--- a/docs/source/library-user-guide/using-the-sql-api.md
+++ b/docs/source/library-user-guide/using-the-sql-api.md
@@ -119,6 +119,8 @@ async fn main() -> Result<()> {
DataFusion can also read Avro files using the `register_avro` method.
```rust
+# #[cfg(feature = "avro")]
+{
use datafusion::arrow::util::pretty;
use datafusion::error::Result;
use datafusion::prelude::*;
@@ -154,6 +156,7 @@ async fn main() -> Result<()> {
);
Ok(())
}
+}
```
## Reading Multiple Files as a table