databendlabs/databend · error · InvalidInput

err.to_string()

Error message

err.to_string()

What it means

After assembling the WebHDFS StorageParams, parse_webhdfs_params calls UriLocation::check() and converts any failure into InvalidInput carrying the inner error's text. It indicates one or more remaining connection options are invalid for the webhdfs scheme.

Solutions

  1. Inspect the embedded inner error message to find the offending option and correct it.
  2. Restrict options to those supported for webhdfs: user_name, https, disable_list_batch.
  3. Remove options that belong to other storage schemes.

Example fix

// before
CREATE STAGE s URL = 'webhdfs://nn:9870/data/' CONNECTION = (usr_name = 'hdfs');
// after
CREATE STAGE s URL = 'webhdfs://nn:9870/data/' CONNECTION = (user_name = 'hdfs');
Defensive patterns

Strategy: try-catch

Validate before calling

const WEBHDFS_OPTS: [&str; 3] = ["user_name", "https", "disable_list_batch"];
assert!(conn_opts.keys().all(|k| WEBHDFS_OPTS.contains(&k.as_str())));

Try / catch

// Rust
if let Err(e) = parse_storage_params_from_uri(&mut loc, usage).await {
    eprintln!("webhdfs connection options rejected: {e}");
    return Err(e);
}

Prevention

When it happens

Trigger: A webhdfs:// location whose CONNECTION options include unrecognized keys or invalid values detected by UriLocation::check() (e.g. misspelled 'user_name', unsupported extras).

Common situations: Reusing S3 or HDFS option sets with webhdfs; typos in supported options (https, disable_list_batch, user_name); stale stage definitions after option renames.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11). Data as JSON: /api/errors/39beb6f38c02797f. Report an issue: GitHub.

Appendix: source

Thrown at src/query/sql/src/planner/binder/location.rs:454

                    "disable_list_batch should be `TRUE` or `FALSE`, parse error with: {:?}",
                    e,
                ),
            )
        })?;
    let user_name = l.connection.get("user_name").cloned().unwrap_or_default();

    let sp = StorageParams::Webhdfs(StorageWebhdfsConfig {
        endpoint_url,
        root,
        delegation,
        disable_list_batch,
        user_name,
        network_config: None,
    });

    l.connection
        .check()
        .map_err(|err| Error::new(ErrorKind::InvalidInput, err.to_string()))?;

    Ok(sp)
}

/// Huggingface uri looks like `hf://opendal/huggingface-testdata/path/to/file`.
///
/// We need to parse `huggingface-testdata` from the root.
fn parse_huggingface_params(l: &mut UriLocation, root: String) -> Result<StorageParams> {
    let (repo_name, root) = root
        .trim_start_matches('/')
        .split_once('/')
        .ok_or_else(|| {
            Error::new(
                ErrorKind::InvalidInput,
                "input uri is not a valid huggingface uri",
            )
        })?;

View on GitHub (pinned to 288d84d76e)