alamb commented on a change in pull request #1243:
URL: https://github.com/apache/arrow-datafusion/pull/1243#discussion_r743835504
##########
File path: datafusion/tests/sql.rs
##########
@@ -687,6 +687,30 @@ async fn select_all() -> Result<()> {
Ok(())
}
+#[tokio::test]
+async fn create_table_as() -> Result<()> {
+ let mut ctx = ExecutionContext::new();
+ register_aggregate_simple_csv(&mut ctx).await?;
+
+ let sql = "CREATE TABLE my_table AS SELECT * FROM aggregate_simple";
Review comment:
So cool ❤️
##########
File path: datafusion/src/physical_plan/planner.rs
##########
@@ -791,6 +791,13 @@ impl DefaultPhysicalPlanner {
"Unsupported logical plan:
CreateExternalTable".to_string(),
))
}
+ | LogicalPlan::CreateMemoryTable {..} => {
+ // Create a dummy exec.
Review comment:
I think it might make more sense here to throw an error about
"unsupported logical plan" -- if we return an `EmptyExec` that will result in a
plan that does nothing (aka doesn't actually create any tables / table
providers) but doesn't error which might be surprising
##########
File path: datafusion/src/execution/context.rs
##########
@@ -237,6 +240,21 @@ impl ExecutionContext {
Ok(Arc::new(DataFrameImpl::new(self.state.clone(), &plan)))
}
+ LogicalPlan::CreateMemoryTable { input, name } => {
Review comment:
this is pretty cool
--
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]