risingwavelabs/risingwave · error · SinkError::Config
database is required
Error message
database is required
What it means
Snowflake tables are addressed with the three-part name database.schema.table. `build_snowflake_task_ctx_jdbc_client` requires the `snowflake.database` option; if absent, it cannot construct the JDBC connection/task context and throws this config error immediately after checking `table.name`.
Source
Thrown at src/connector/src/sink/snowflake_redshift/snowflake.rs:375
schema: &Schema,
pk_indices: &Vec<usize>,
) -> Result<Option<(SnowflakeTaskContext, JdbcJniClient)>> {
if !self.auto_schema_change
&& is_append_only
&& !self.create_table_if_not_exists
&& !self.with_s3
{
// append-only + no auto schema change is not need to create a client
return Ok(None);
}
let target_table_name = self
.snowflake_target_table_name
.clone()
.ok_or(SinkError::Config(anyhow!("table.name is required")))?;
let database = self
.snowflake_database
.clone()
.ok_or(SinkError::Config(anyhow!("database is required")))?;
let schema_name = self
.snowflake_schema
.clone()
.ok_or(SinkError::Config(anyhow!("schema is required")))?;
let mut snowflake_task_ctx = SnowflakeTaskContext {
target_table_name: target_table_name.clone(),
database,
schema_name,
schema: schema.clone(),
..Default::default()
};
let (jdbc_url, connection_properties) = self.build_jdbc_connection_properties()?;
let client = JdbcJniClient::new_with_props(jdbc_url, connection_properties)?;
if self.with_s3 {
let stage = self
.stageView on GitHub (pinned to 6469eb736d)
Solutions
- Add `snowflake.database = '<database>'` to the sink WITH options.
- Check spelling of the option key (`snowflake.database`).
- Ensure any templated value for the database resolves to a non-empty string.
Example fix
// before WITH ( connector = 'snowflake', snowflake.schema = 'public', table.name = 'my_table' ) // after WITH ( connector = 'snowflake', snowflake.database = 'mydb', snowflake.schema = 'public', table.name = 'my_table' )
Defensive patterns
Strategy: validation
Validate before calling
if (!opts['snowflake.database']) throw new Error('snowflake.database is required for snowflake sink'); Try / catch
try { createSink(opts) } catch (e) { if (String(e).includes('database is required')) { /* add snowflake.database and retry */ } } Prevention
- Always specify the full three-part table name inputs (database, schema, table.name).
- Do not rely on the Snowflake user's default database.
- Centralize database/schema defaults in one template.
When it happens
Trigger: Creating a Snowflake sink without `snowflake.database` in the WITH options while a JDBC client is being built (sink creation path).
Common situations: Assuming the user's default database applies, or omitting the option when copying examples that had it set via a variable.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- intermediate.table.name is required for non-append-only sink
- auth.method=key_pair_object must not set `password`
- ambiguous auth: multiple auth options provided; remove one o
- table.name is required
- schema is required
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/b1ce0616ca77bd51.
Report an issue: GitHub.