jerry-024 commented on code in PR #309:
URL: https://github.com/apache/paimon-rust/pull/309#discussion_r3206099757


##########
crates/integrations/datafusion/src/sql_context.rs:
##########
@@ -262,6 +375,23 @@ impl SQLContext {
                 self.ctx.sql(sql).await
             }
             Statement::Truncate(truncate) => 
self.handle_truncate_table(truncate).await,
+            Statement::CreateView(create_view) => 
self.handle_create_view(create_view).await,

Review Comment:
   **P0 — Must fix (breaks non-Paimon catalogs)**
   
   This intercepts **all** `CREATE VIEW` statements, and the `Statement::Drop` 
arm below (line 385) intercepts all `DROP TABLE` / `DROP VIEW`. Before this PR, 
these would fall through to `self.ctx.sql(sql)` and be handled by DataFusion 
normally.
   
   Now:
   - `CREATE VIEW datafusion.public.my_view AS ...` → errors with "CREATE VIEW 
(non-temporary) is not supported" (line 1113), even though DataFusion can 
handle it.
   - `DROP TABLE datafusion.public.x` → `resolve_catalog_and_table` looks up 
only Paimon catalogs and fails with "Unknown catalog 'datafusion'".
   
   **Suggestion:** Only intercept these statements when the resolved catalog is 
a registered Paimon catalog. If the catalog name doesn't exist in 
`self.catalogs`, fall through to `self.ctx.sql(sql).await` for DataFusion's 
default handling.



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

Reply via email to