Build and deploy Java UDFs to make predictions on your data using H2O Driverless AI and H2O-3 models right within Snowflake.
Packages
Quick Start
Packages
Version |
Last Built |
Archive File Format |
Package |
0.0.6 |
2024-11-28 |
tgz |
Download |
0.0.6 |
2024-11-28 |
zip |
Download |
Description
- This quick start guide provides helps you get started with Java UDFs to score H2O DAI and H2O-3 models within Snowflake. That is, make predictions on Snowflake data with
H2O.ai's DAI/H2O-3 machine learning models using Java UDFs, that can be invoked via SQL just like any other function in Snowflake.
Setup a Snowflake stage (High Live Step - 1)
- Create a Snowflake stage and grant appropriate Privileges
- Copy the H2o-Dai-Score and H2o3-Score JAR files to the Snowflake stage
Copying the jar file to your stage
- Copy the following H2O's artifacts to the Snowflake stage:
- mojo2-runtime.jar (DAI MOJO only)
- a valid Driverless AI license file (H2O DAI only)
- h2o-genmodel.jar (H2O-3 only)
- H2O DAI / H2O-3 model(s)
Creating a Function in Snowflake (High Live Step - 2)
-
Execute a CREATE FUNCTION statement and specify the name of the function, the location/stage of the JAR (and other files), and the Java method that should be invoked when the Java UDF is called.
Creating the function in Snowflake
Calling the Function in Snowflake (High Live Step - 3)
-
Just like any other function in Snowflake, the Java UDF can be invoked via a SQL command:
select JAVA_UDF_FUNCTION_NAME(JAVA_UDF_FUNCTION_PARAMS) from TABLE_NAME;