diff --git a/src/main/java/com/snowflake/snowpark_java/SessionBuilder.java b/src/main/java/com/snowflake/snowpark_java/SessionBuilder.java index 210a426e..e9675a34 100644 --- a/src/main/java/com/snowflake/snowpark_java/SessionBuilder.java +++ b/src/main/java/com/snowflake/snowpark_java/SessionBuilder.java @@ -78,6 +78,9 @@ public Session create() { * @since 1.10.0 */ public Session getOrCreate() { + // disable closure cleaner in Java session, + // it only works with Scala UDF. + this.builder.config("snowpark_enable_closure_cleaner", "never"); return new Session(this.builder.getOrCreate()); } }