alamb commented on code in PR #26291:
URL: https://github.com/apache/datafusion/pull/26291#discussion_r4299194200


##########
datafusion/core/examples/query.rs:
##########
@@ -0,0 +1,63 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Query in-memory data with SQL and the DataFrame API.
+//!
+//! Run with `cargo run -p datafusion --example query`.
+//! This example is also included in the published crate so rustdoc can show
+//! its call sites alongside the API documentation.
+
+use std::sync::Arc;
+
+use datafusion::arrow::array::Int32Array;
+use datafusion::arrow::record_batch::RecordBatch;
+use datafusion::common::assert_batches_eq;
+use datafusion::error::Result;
+use datafusion::prelude::*;
+
+#[tokio::main(flavor = "current_thread")]

Review Comment:
   There is a whole crate of examples here: 
https://github.com/apache/datafusion/tree/main/datafusion-examples
   
   This one, for example, is pretty similar to a bunch of existing examples
   - 
https://github.com/apache/datafusion/blob/0d79252f61bd8777990b2749c216ffd07079c30d/docs/source/library-user-guide/using-the-dataframe-api.md#L78-L112
 (register_batch + sql + filter + collect + assert_batches_eq)
   - 
https://github.com/apache/datafusion/blob/0d79252f61bd8777990b2749c216ffd07079c30d/datafusion-examples/examples/dataframe/dataframe.rs#L160-L178
 (read_memory runnable example)
   
   
   I realize we can't reuse datafusion-examples without moving them all to the 
core crate which is a more substantial change. 
   
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to