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