You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "devoopsman45 (via GitHub)" <gi...@apache.org> on 2026/06/05 23:39:35 UTC

[I] feat(session): add tableExists and deregisterTable to SessionContext [datafusion-java]

devoopsman45 opened a new issue, #101:
URL: https://github.com/apache/datafusion-java/issues/101

   ### Is your feature request related to a problem or challenge?
   
   # Problem
     
     `SessionContext` can let a caller register tables but there is no way to  
   
     - Check whether a table name is already registered
     - Remove a registered table from the session
     
     This makes it tough to write safer code while registering:
     
     ```java
     // guard against double-registration — not possible today
     if (!ctx.tableExists("orders")) {
         ctx.registerCsv("orders", path);
     }
     
     // clean up a table when done — not possible today
     ctx.deregisterTable("orders");
   
     Long-lived sessions that register and swap out tables dynamically, tests
     that need to clean up state between runs, and any application managing
     multiple datasets in one session all hit this gap.
   
   
   ### Describe the solution you'd like
   
   Add two methods to SessionContext:
   
     public boolean tableExists(String name)
     public void deregisterTable(String name)
   
     Both are thin wrappers over SessionContext::table_exist and
     SessionContext::deregister_table which already exist in the
     DataFusion Rust API.
   
   
   ### Describe alternatives you've considered
   
   Using ctx.sql("SHOW TABLES") to check for table existence is possible but requires executing a full query. For the deregistering, there is no SQL based workaround
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] feat(session): add tableExists and deregisterTable to SessionContext [datafusion-java]

Posted by "coderfender (via GitHub)" <gi...@apache.org>.
coderfender closed issue #101: feat(session): add tableExists and deregisterTable to SessionContext
URL: https://github.com/apache/datafusion-java/issues/101


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] feat(session): add tableExists and deregisterTable to SessionContext [datafusion-java]

Posted by "hiteshkumardasika (via GitHub)" <gi...@apache.org>.
hiteshkumardasika commented on issue #101:
URL: https://github.com/apache/datafusion-java/issues/101#issuecomment-4636666924

   @coderfender please review 


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org