devoopsman45 commented on code in PR #102:
URL: https://github.com/apache/datafusion-java/pull/102#discussion_r3367378618
##########
core/src/main/java/org/apache/datafusion/SessionContext.java:
##########
@@ -601,6 +601,35 @@ private static byte[] serializeSchemaIpc(Schema schema) {
return baos.toByteArray();
}
+ /**
+ * Returns {@code true} if a table with the given name is registered in this
session.
+ *
+ * <p>This is the Java counterpart to DataFusion's Rust {@code
SessionContext::table_exist}.
+ *
+ * @throws IllegalStateException if this context is closed.
+ */
+ public boolean tableExists(String name) {
+ if (nativeHandle == 0) {
+ throw new IllegalStateException("SessionContext is closed");
+ }
+ return tableExists(nativeHandle, name);
+ }
+
+ /**
+ * Removes the table with the given name from this session. Does nothing if
no table with that
+ * name is registered.
+ *
+ * <p>This is the Java counterpart to DataFusion's Rust {@code
SessionContext::deregister_table}.
+ *
+ * @throws IllegalStateException if this context is closed.
+ */
+ public void deregisterTable(String name) {
+ if (nativeHandle == 0) {
+ throw new IllegalStateException("SessionContext is closed");
Review Comment:
Please check the comment above
--
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]