devoopsman45 commented on code in PR #102:
URL: https://github.com/apache/datafusion-java/pull/102#discussion_r3368234154
##########
native/src/lib.rs:
##########
@@ -1042,6 +1042,41 @@ pub extern "system" fn
Java_org_apache_datafusion_SessionContext_getOptionNative
)
}
+#[no_mangle]
+pub extern "system" fn
Java_org_apache_datafusion_SessionContext_tableExists<'local>(
+ mut env: JNIEnv<'local>,
+ _class: JClass<'local>,
+ handle: jlong,
+ name: JString<'local>,
+) -> jboolean {
+ try_unwrap_or_throw(&mut env, 0, |env| -> JniResult<jboolean> {
+ if handle == 0 {
+ return Err("SessionContext handle is null".into());
+ }
+ let ctx = unsafe { &*(handle as *const SessionContext) };
+ let name: String = env.get_string(&name)?.into();
+ Ok(ctx.table_exist(&name)? as jboolean)
+ })
+}
+
+#[no_mangle]
+pub extern "system" fn
Java_org_apache_datafusion_SessionContext_deregisterTable<'local>(
+ mut env: JNIEnv<'local>,
+ _class: JClass<'local>,
+ handle: jlong,
+ name: JString<'local>,
+) {
+ try_unwrap_or_throw(&mut env, (), |env| -> JniResult<()> {
+ if handle == 0 {
+ return Err("SessionContext handle is null".into());
+ }
+ let ctx = unsafe { &*(handle as *const SessionContext) };
Review Comment:
I will create follow up issue once this change gets merged. That way, I can
make use of the inline functions/methods created in here.
@coderfender
Thank you
--
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]