JDBC example
- Python
- Scala
from featurestore import Client, JdbcTable
# Initialise feature store client
client = Client("ip:port")
client.auth.login()
# Set project specifics
project = client.projects.create("demo")
# Create the jdbc source
jdbc_source = JdbcTable("<connection_url>", "<table>")
jdbc_source_schema = client.extract_schema_from_source(jdbc_source)
# Register the feature set
my_feature_set = project.feature_sets.register(jdbc_source_schema, "feature_set_name", primary_key=["key_name"])
# Ingest to cache
my_feature_set.ingest(jdbc_source)
# Retrieve feature set
ref = my_feature_set.retrieve()
ref.download()
import ai.h2o.featurestore.Client
import ai.h2o.featurestore.core.sources.JdbcTable
// Initialise feature store client
val client = Client("url")
client.auth.setAuthToken(...)
// Set project specifics
val project = client.projects.create("demo")
// Create the jdbc source
val jdbcSource = JdbcTable("<connection_url>", "<table>")
val jdbcSourceSchema = client.extractSchemaFromSource(jdbcSource)
// Register the feature set
val myFeatureSet = project.featureSets.register(jdbcSourceSchema, "featureSetName", primaryKey=Seq("keyName"))
// Ingest to cache
myFeatureSet.ingest(jdbcSource)
// Retrieve feature set
val ref = myFeatureSet.retrieve()
ref.download()
Feedback
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai