{"record":{"id":"bb6c6074ceef2f4d","repo":"risingwavelabs/risingwave","slug":"unsupported-version-string-in-iceberg-time-travel","errorCode":null,"errorMessage":"Unsupported version string in iceberg time travel","messagePattern":"Unsupported version string in iceberg time travel","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/optimizer/plan_node/utils.rs","lineNumber":585,"sourceCode":"                .ok_or_else(|| anyhow!(\"invalid timestamp\"))?\n        }\n    };\n    Ok(Some(PbBatchQueryEpoch {\n        epoch: Some(batch_query_epoch::PbEpoch::TimeTravel(\n            unix_timestamp_sec_to_epoch(timestamp).0,\n        )),\n    }))\n}\n\npub fn to_iceberg_time_travel_as_of(\n    a: &Option<AsOf>,\n    timezone: &String,\n) -> Result<Option<IcebergTimeTravelInfo>> {\n    Ok(match a {\n        Some(AsOf::VersionNum(v)) => Some(IcebergTimeTravelInfo::Version(*v)),\n        Some(AsOf::TimestampNum(ts)) => Some(IcebergTimeTravelInfo::TimestampMs(ts * 1000)),\n        Some(AsOf::VersionString(_)) => {\n            bail!(\"Unsupported version string in iceberg time travel\")\n        }\n        Some(AsOf::TimestampString(ts)) => {\n            let date_time = speedate::DateTime::parse_str_rfc3339(ts)\n                .map_err(|_e| anyhow!(\"failed to parse the timestamp\"))?;\n            let timestamp = if date_time.time.tz_offset.is_none() {\n                // If the input does not specify a time zone, use the time zone set by the \"SET TIME ZONE\" command.\n                let tz = Timestamptz::lookup_time_zone(timezone).map_err(|e| anyhow!(e))?;\n                match tz.with_ymd_and_hms(\n                    date_time.date.year.into(),\n                    date_time.date.month.into(),\n                    date_time.date.day.into(),\n                    date_time.time.hour.into(),\n                    date_time.time.minute.into(),\n                    date_time.time.second.into(),\n                ) {\n                    MappedLocalTime::Single(d) => Ok(d.timestamp()),\n                    MappedLocalTime::Ambiguous(_, _) | MappedLocalTime::None => {\n                        Err(anyhow!(format!(","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/optimizer/plan_node/utils.rs#L567-L603","documentation":"to_iceberg_time_travel_as_of maps an AsOf clause to IcebergTimeTravelInfo. Iceberg time travel supports numeric snapshot versions and timestamps, but a string version (AsOf::VersionString) is not supported, so the function bails with this error.","triggerScenarios":"Querying an Iceberg table/metadata table with AS OF VERSION '<string>' where the version is a quoted string rather than a number, e.g. AS OF VERSION 'v3' or AS OF VERSION '123' (string-typed).","commonSituations":"Users referencing snapshots by name or by quoted snapshot IDs; SQL drivers that pass version literals as strings; documentation examples using string versions.","solutions":["Use a numeric snapshot ID: AS OF VERSION 1234567890.","Look up the numeric snapshot ID from the Iceberg metadata and pass it unquoted.","Use AS OF TIMESTAMP with an RFC3339 string if you want time-based travel instead of version-based."],"exampleFix":"// before\nSELECT * FROM iceberg_table AS OF VERSION '1234567890';\n// after\nSELECT * FROM iceberg_table AS OF VERSION 1234567890;","handlingStrategy":"validation","validationCode":"// ensure Iceberg snapshot version is numeric before query\nlet version: i64 = snapshot_id.parse().expect(\"AS OF VERSION must be numeric for Iceberg\");","typeGuard":"fn is_numeric_version(s: &str) -> bool { s.parse::<i64>().is_ok() }","tryCatchPattern":"match res {\n    Err(e) if e.to_string().contains(\"Unsupported version string\") => eprintln!(\"Iceberg time travel requires a numeric AS OF VERSION; use AS OF TIMESTAMP for time-based travel\"),\n    other => other?,\n}","preventionTips":["Never quote Iceberg snapshot IDs in AS OF VERSION.","Resolve snapshot IDs from Iceberg metadata before querying.","Prefer AS OF TIMESTAMP for human-facing time travel."],"tags":["iceberg","time-travel","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}