Skip to content

[#11813] fix(gvfs): override getScheme() to return 'gvfs'#11814

Merged
yuqi1129 merged 1 commit into
apache:mainfrom
whua3:fix/gvfs-getscheme-override
Jun 29, 2026
Merged

[#11813] fix(gvfs): override getScheme() to return 'gvfs'#11814
yuqi1129 merged 1 commit into
apache:mainfrom
whua3:fix/gvfs-getscheme-override

Conversation

@whua3

@whua3 whua3 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

FileSystem#getScheme() throws UnsupportedOperationException by default, which breaks Hadoop/Spark commit protocols (e.g. FileOutputCommitter, ManifestCommitter) when writing to a gvfs:// path. Override getScheme() in GravitinoVirtualFileSystem to return the GVFS scheme constant. Added unit test testGetScheme in TestGvfsBase.

What changes were proposed in this pull request?

Override getScheme() in GravitinoVirtualFileSystem to return the GVFS scheme constant (gvfs), instead of relying on the default org.apache.hadoop.fs.FileSystem#getScheme() which throws UnsupportedOperationException.

@Override
public String getScheme() {
  return GravitinoVirtualFileSystemConfiguration.GVFS_SCHEME;
}

Why are the changes needed?

Hadoop's default FileSystem#getScheme() throws UnsupportedOperationException if a subclass doesn't override it. Hadoop / Spark commit protocols call getScheme() during job setup / commit, so writing to a gvfs:// path currently fails. Returning the well-known gvfs scheme — which is already the URI scheme GVFS advertises and the value of GravitinoVirtualFileSystemConfiguration.GVFS_SCHEME — makes GVFS behave like every other Hadoop FileSystem implementation (LocalFS → file, HDFS → hdfs, S3A → s3a, …).

Fix: #11813

Does this PR introduce any user-facing change?

No public API change. FileSystem#getScheme() on a GravitinoVirtualFileSystem instance now returns "gvfs" instead of throwing. No new / removed configuration keys.

How was this patch tested?

Added a new unit test TestGvfsBase#testGetScheme that asserts fs.getScheme() equals GravitinoVirtualFileSystemConfiguration.GVFS_SCHEME. Ran ./gradlew :clients:filesystem-hadoop3:test locally and all tests pass.

FileSystem#getScheme() throws UnsupportedOperationException by default, which breaks Hadoop/Spark commit protocols (e.g. FileOutputCommitter, ManifestCommitter) when writing to a gvfs:// path. Override getScheme() in GravitinoVirtualFileSystem to return the GVFS scheme constant. Added unit test testGetScheme in TestGvfsBase.
@github-actions

Copy link
Copy Markdown

Code Coverage Report

Overall Project 67.23% +0.01% 🟢
Files changed 70.9% 🟢

Module Coverage
aliyun 1.72% 🔴
api 46.82% 🟢
authorization-common 85.96% 🟢
aws 26.5% 🔴
azure 2.47% 🔴
catalog-common 10.4% 🔴
catalog-fileset 80.23% 🟢
catalog-glue 66.91% 🟢
catalog-hive 79.42% 🟢
catalog-jdbc-clickhouse 80.02% 🟢
catalog-jdbc-common 44.22% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 80.91% 🟢
catalog-jdbc-postgresql 82.29% 🟢
catalog-jdbc-starrocks 78.51% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 58.53% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.86% 🟢
catalog-lakehouse-paimon 82.14% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 78.01% 🟢
common 50.17% 🟢
core 82.59% 🟢
filesystem-hadoop3 77.3% -1.26% 🟢
flink 0.0% 🔴
flink-common 47.12% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-common 10.88% 🔴
hive-metastore-common 53.77% 🟢
iceberg-common 58.15% 🟢
iceberg-rest-server 73.9% 🟢
idp-basic 85.71% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 20.83% 🔴
lance-rest-server 60.13% 🟢
lineage 53.02% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 85.96% 🟢
server-common 74.18% 🟢
spark 28.57% 🔴
spark-common 41.66% 🟢
trino-connector 40.29% 🟢
Files
Module File Coverage
filesystem-hadoop3 GravitinoVirtualFileSystem.java 70.9% 🟢

@yuqi1129 yuqi1129 added the branch-1.3 Automatically cherry-pick commit to branch-1.3 label Jun 29, 2026
@yuqi1129 yuqi1129 merged commit 3dd3b8f into apache:main Jun 29, 2026
32 checks passed
yuqi1129 pushed a commit that referenced this pull request Jun 29, 2026
…to return 'gvfs' (#11814) (#11818)

**Cherry-pick Information:**
- Original commit: 3dd3b8f
- Target branch: `branch-1.3`
- Status: ✅ Clean cherry-pick (no conflicts)

Co-authored-by: Gary Wang <34413055+whua3@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-1.3 Automatically cherry-pick commit to branch-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug report] GravitinoVirtualFileSystem.getScheme() throws UnsupportedOperationException, breaking Spark/MapReduce commit jobs

2 participants