Skip to content

fix: fall back to Spark for an Iceberg location with user info in its authority - #7744

Draft
dwsmith1983 wants to merge 1 commit into
apache:mainfrom
dwsmith1983:fix/7732-iceberg-userinfo-fallback
Draft

dwsmith1983 wants to merge 1 commit into
apache:mainfrom
dwsmith1983:fix/7732-iceberg-userinfo-fallback

Conversation

@dwsmith1983

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #7732.

Rationale for this change

iceberg-rust's storages cannot open a location with user info in its authority, such as s3://alice:SECRET@bucket/t/f.parquet. The object stores take the bucket from the host and then require the path to start with scheme://bucket/, and the HDFS storage rejects user info outright. Comet still planned the native scan or write, the task failed, and the iceberg-rust error printed the whole location, password included (apache/iceberg-rust#3746).

The issue suggested a native rejection that names the location through redacted_url_display. This declines in the JVM instead, so the location never reaches iceberg-rust and no reason has to name it.

What changes are included in this PR?

  • NativeConfig.hasUserInfo reports user info in a location's raw authority. A text form covers locations java.net.URI rejects, such as a password with an unencoded space, after removing the tab, newline and surrounding whitespace that URL parsing ignores.
  • The Iceberg scan falls back when a data or delete file location has user info: Iceberg scan references a data/delete file location with user info in its authority, which Comet's native Iceberg reader cannot open. Such a location is kept out of the bucket, HDFS and storage-family checks, so their reasons cannot print it.
  • The Iceberg write falls back when the data location has user info: <scheme> data location carries user info in its authority.
  • iceberg.md lists both fallbacks.

No object-store or HDFS location that works today changes. A file location with user info, which iceberg-rust would resolve to a different local path, and a memory one now fall back too. The metadata location is not checked: native only reads its scheme and bucket, so a table with user info only there still runs natively.

A password whose /, ? or # ends the authority early (s3://alice:/SECRET@bucket/p) has no user info as far as the parser can tell, so it still goes native; that case is left to apache/iceberg-rust#3746.

This touches the same functions as #7743. Merging this one first is simpler; #7743 then keeps both branches in requireSupportedStorageScheme, the iceberg.md table row and the write test.

How are these changes tested?

NativeConfigSuite covers hasUserInfo for user, password, empty user info, a registry host, IPv6, HDFS, file, an @ in the path, query or fragment, opaque URIs, locations URI rejects, and the early-authority shape. CometScanSchemeFallbackSuite declines scans with user info in an HDFS, S3, S3-compliant alias, file or schemeless data file and in a delete file, checks an HDFS scan is not probed for an encryption zone with the user info in its path, and keeps a partition value with @ native. CometIcebergWriteDetectionSuite checks the write reason, including a location with a tab, and that the unsupported-scheme reason still wins for HDFS. Each new test fails on main.

… authority

iceberg-rust's storages cannot open a location such as
s3://alice:SECRET@bucket/t/f.parquet: the object stores take the bucket
from the host and then require the path to start with scheme://bucket/,
and the HDFS storage rejects user info outright. Comet still planned the
native scan or write, the task failed, and the iceberg-rust error printed
the whole location, password included.

The Iceberg scan now falls back when a data or delete file location has
user info in its authority, and the write falls back when the data
location does, with reasons that do not name the location.
NativeConfig.hasUserInfo reads the raw authority, and a text form covers
locations java.net.URI rejects, after stripping the characters URL
parsing ignores.

Closes apache#7732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Iceberg reads pass a location with credentials to iceberg-rust, whose errors print it

1 participant