Skip to content

Accept the plain abfs scheme on the DataLake catalog read path - #131389

Merged
fm4v merged 2 commits into
masterfrom
nik/datalake-accept-abfs-scheme
Nov 13, 2026
Merged

fm4v merged 2 commits into
masterfrom
nik/datalake-accept-abfs-scheme

Conversation

@fm4v

@fm4v fm4v commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Microsoft Fabric's OneLake Iceberg REST catalog reports the locations of Fabric-written tables (for example tables created by a Fabric notebook or virtualized from Delta) with the plain abfs:// scheme, and its /v1/config carries no default-base-location. DatabaseDataLake then derives the storage type from the table location, and reading such a table fails with Code: 48. DB::Exception: Unsupported storage type: abfs://. (NOT_IMPLEMENTED).

Two places accepted only the secure spelling:

  1. DataLake::tryParseStorageTypeFromString mapped only abfss to Azure.
  2. AzureStorageParsedArguments::fillBlobsFromURLCommon parsed the Hadoop-style URL only when it started with abfss, leaving storage_account_url empty for abfs://. Fixing only (1) moves the failure one layer down.

Both now accept abfs and abfss, which name the same ADLS Gen2 storage. The check in (2) includes the :// separator, so a near-prefix scheme such as abfsx:// is still not treated as ADLS Gen2. StorageURL.cpp already treats the two spellings identically. There is no TLS downgrade: the OneLake endpoint is always built as https:// from onelake_use_blob_endpoint, never from the location scheme.

Tests: new arms in gtest_azure_abfss_parsing.cpp and a new gtest_azure_abfs_url_parsing.cpp, which fail before the change with the production error and an empty storage_account_url respectively. The end-to-end OneLake read path is covered by private E2E tests against live Fabric.

Closes: #131292

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fixed Unsupported storage type: abfs:// when reading a table from a DataLakeCatalog database (for example OneLake) whose catalog reports table locations with the plain abfs:// scheme. Previously only abfss:// was accepted, although both name the same ADLS Gen2 storage.


Workflow [PR]
Sync PR [sync-upstream/pr/131389]

Version info

  • Merged into: 26.11.1.2253-master (included in 26.11 and later)
  • Backported to: 26.10.5.2, 26.9.28.165

OneLake reports the locations of Fabric-written tables with the plain `abfs://` scheme, and reading them failed with `Unsupported storage type: abfs://`. `tryParseStorageTypeFromString` mapped only `abfss` to `Azure`, and `fillBlobsFromURLCommon` parsed only `abfss` URLs, so fixing the first alone moved the failure one layer down. Both now accept `abfs` and `abfss`, which name the same ADLS Gen2 storage. The scheme selects the storage engine, not the wire protocol: the OneLake endpoint is always built as `https://`.

Closes: #131292
Related: ClickHouse/clickhouse-private#87864
@clickhouse-gh

clickhouse-gh Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [06b9f83]


AI Review

Summary

The PR accepts abfs:// catalog locations as Azure and handles mixed abfs/abfss metadata pointers. The previous mixed-scheme finding is fixed at 06b9f83c413332af0838fe2efc5f25b2637c7c9a. One newly accepted location shape still loses its table directory, so changes are required.

Findings

❌ Blockers

  • src/Storages/ObjectStorage/Azure/Configuration.cpp:213: Single-segment table paths are discarded. For abfs://[email protected]/table, fillBlobsFromURLCommon successfully extracts the account/container but leaves blob_path.path empty: the preceding split only stores the path if it contains another /. That empty path reaches the Azure Delta reader, which opens the container-root _delta_log instead of table/_delta_log; REST Iceberg metadata pointers also resolve from the wrong root. The split predates this PR, but newly accepted abfs locations reach it. Preserve the full path after the authority for both ABFS spellings. A standalone reproduction executing the verbatim parser confirms that table becomes empty while table/ and dir/table remain intact.
Tests
  • ⚠️ Add a focused regression for abfs://[email protected]/table without a trailing slash, asserting blob_path.path == "table". The new parser tests check the account/container but omit the path. Assert the nested OneLake path as well.
Missing context / blind spots
  • ⚠️ No configured ClickHouse build or live Fabric run was available. The local reproduction executes the parser with minimal data-holder and exception stubs; full server and live Azure behavior were traced in source rather than executed.
Final Verdict

❌ Block — preserve single-segment table paths and add regression coverage. The earlier resolved thread needs no further action.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Nov 13, 2026
Comment thread src/Databases/DataLake/ICatalog.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 06b9f83c4 with master 75d30c631 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Slowest function optimization changes (ThinLTO)

Median per-function time ratio to the master baseline: programs/clickhouse ×0.62, programs/clickhouse-keeper ×0.86 (each binary is linked separately, on a different machine and with different build flags); deltas below are relative to it.

Binary Function Master PR Δ vs median
programs/clickhouse DB::registerFunctionConversion(DB::FunctionFactory&) 6.7 s 9.8 s +5.7 s (+136%)
Compile time of recompiled translation units

8 translation units recompiled, 18 s compile time in total, 8 of them have a recent master baseline.

Job report

@clickhouse-gh clickhouse-gh Bot added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Nov 13, 2026
`TableMetadata::getMetadataLocation` removed only the exact scheme of the table location, so a catalog that reports the table location with `abfs://` and the metadata location with `abfss://` (or the reverse) got the whole URI back, and `resolvePathInsideTable` appended it to the table path. Both spellings name the same ADLS Gen2 storage, so either is now removed when the table is on ABFS.

#131389 (comment)
// Sample abfss url : abfss://[email protected]/subdirectory/file.txt
if (connection_url.starts_with("abfss"))
/// `abfs` and `abfss` name the same ADLS Gen2 storage; both carry `://` so a near-prefix scheme like `abfsx://` is not matched.
if (connection_url.starts_with("abfss://") || connection_url.starts_with("abfs://"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Blocker] Preserve single-segment table paths on the newly accepted Azure route

A valid Unity/REST catalog location such as abfs://[email protected]/table now reaches this branch, but fillBlobsFromURLCommon returns an empty blob_path.path instead of table. The preceding split at lines 199–207 only saves the path when the part after the host contains another /; here that part is just table, so it is discarded. The account and container still parse successfully.

StorageAzureConfiguration::initializeFromParsedArguments copies that empty path unchanged. Consequently, the Azure Delta reader opens the container-root _delta_log instead of table/_delta_log; the REST Iceberg route likewise resolves a relative catalog metadata pointer against the container root. These newly accepted table locations remain unreadable. A standalone reproduction using the verbatim parser confirms that table becomes empty while table/ and dir/table are preserved.

The split predates this PR, but the new scheme support routes these inputs through it. Please retain the complete path after the authority for both ABFS spellings and add a regression assertion for blob_path.path == "table". The added parser tests currently check only the account and container, so they miss this loss.

@peter-leonov-ch

Copy link
Copy Markdown

@fm4v we'd need the v26.8-must-backport label too please.

@fm4v

fm4v commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

v26.4-must-backport includes 26.8

@fm4v
fm4v added this pull request to the merge queue Nov 13, 2026
Merged via the queue into master with commit f0a9e6b Nov 13, 2026
182 of 205 checks passed
@fm4v
fm4v deleted the nik/datalake-accept-abfs-scheme branch November 13, 2026 22:01
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 13, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 13, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 13, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 14, 2026
Backport #131389 to 26.10: Accept the plain `abfs` scheme on the DataLake catalog read path
clickhouse-gh Bot added a commit that referenced this pull request Nov 14, 2026
Backport #131389 to 26.9: Accept the plain `abfs` scheme on the DataLake catalog read path
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Nov 14, 2026
The job is in `CORE_BLOCKING_JOB_NAMES` of the PR workflow, so stage 2 (about 145 jobs) waits for it. Its sequential tests take about 48 minutes in total, so it ended about 25 minutes after the rest of the gate on most PR runs. With two hash batches each one takes about 24 minutes of tests, in line with the other gate jobs.

Example: https://github.com/ClickHouse/ClickHouse/actions/runs/43497656163 (PR ClickHouse#131389)
@clickhouse-gh clickhouse-gh Bot added comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.6-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataLakeCatalog OneLake: tables with abfs:// locations fail with Unsupported storage type: abfs://

3 participants