Package dev.frostlake.executor.udf
package dev.frostlake.executor.udf
-
ClassDescriptionClassloader for IMPORTS handler jars that prefers the jar (and its stage-sibling dependency jars) over the engine's classpath — the equivalent of Snowflake running a UDF against the dependency set its PACKAGES clause supplies, not against whatever the warehouse happens to have loaded.In-memory class loaderIn-memory Java file objectIn-memory file managerLoads a pre-compiled handler class from the JAR(s) named in a UDF/procedure's
IMPORTSclause — the alternative to an inlineAS $$ … $$body.Compiles and executes inline Java user-defined functionsExecutes inline Java stored procedures by compiling them at runtime.What anIMPORTS = ('@stage/file.jar')clause has to be true of at CREATE time.Whether a statement creates a TEMPORARY object, and which kind Snowflake calls it — the question an owner's rights stored procedure has to answer before running a handler's statement.Routes Truffle/polyglot log output into SLF4J — the "configure logging using the polyglot embedding API" option: installed as theengine log handler, so GraalVM's warnings and diagnostics land in the engine log (with per-language logger names under thepolyglot.prefix) instead of being printed to stderr.Routes a JVM-handler UDF's console output (System.out/System.errwritten on the invoking thread) into the engine log instead of the embedder's console.ThePrintStreamtypeUdfConsoleCaptureinstalls overSystem.out/System.err— a plain auto-flushing stream whose distinct class lets the capture recognize (viainstanceof) whether its wrapper is still installed after a test harness swaps the system streams.TheOutputStreambehindUdfConsolePrintStream: bytes written by a thread inside a UDF handler (UdfConsoleCapture.isCapturing()) are buffered per thread and relayed to the engine log line by line; every other write passes straight through to the original stream.Executes UDFs and stored procedures of oneUdfLanguage.Registry of theUdfLanguageRuntimeproviders on the classpath, discovered once at first use.