notfilippo commented on code in PR #11160:
URL: https://github.com/apache/datafusion/pull/11160#discussion_r1664325625
##########
datafusion-examples/examples/logical_type.rs:
##########
@@ -0,0 +1,108 @@
+use datafusion::datasource::TableProvider;
+use datafusion::execution::context::SessionState;
+use datafusion::physical_plan::ExecutionPlan;
+use datafusion_common::logical_type::schema::{LogicalSchema, LogicalSchemaRef};
+use datafusion::error::Result;
+use datafusion_expr::{Expr, TableType};
+use std::any::Any;
+use std::sync::Arc;
+use arrow::util::pretty::pretty_format_batches;
+use arrow_schema::{DataType, Field, TimeUnit};
+use datafusion::prelude::SessionContext;
+use datafusion_common::logical_type::{ExtensionType};
+use datafusion_common::logical_type::field::LogicalField;
+use datafusion_common::logical_type::signature::LogicalType;
+
+#[tokio::main]
+async fn main() -> Result<()> {
+ let ctx = SessionContext::new();
+ ctx.register_table("example", Arc::new(ExampleTableSource::default()))?;
+
+ let df = ctx.sql("SELECT * FROM example").await?;
+ let records = df.collect().await?;
+
+ println!("{}", pretty_format_batches(&records)?);
Review Comment:
> Like I wonder is the idea that we could now create a ScalarFunctionImpl
whose signature refers to LogicalType rather than PhysicalType 🤔 Or somehow
plan a binary operation on logical types?
Potentially both. The motivation behind this change is to simplify the
interaction between standard types represented by different encodings (like
RunArray, the various Views and DictionaryArray but potentially also user
defined ones via Arrow Extension Types).
--
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]