Skip to content

feat: support reading Lance tables on Hadoop-family filesystems (tbdsfs/hdfs) - #73

Merged
fightBoxing merged 4 commits into
lance-format:mainfrom
fightBoxing:feature/tbdsfs-hadoop-fs-fallback
Aug 27, 2026
Merged

feat: support reading Lance tables on Hadoop-family filesystems (tbdsfs/hdfs)#73
fightBoxing merged 4 commits into
lance-format:mainfrom
fightBoxing:feature/tbdsfs-hadoop-fs-fallback

Conversation

@fightBoxing

Copy link
Copy Markdown
Collaborator

Summary

Adds support for reading Lance tables stored on Hadoop-family filesystems (tbdsfs, hdfs), built on top of the existing time-travel layer. This also fixes three bugs that blocked tbdsfs reads in YARN.

Changes

feat: Hadoop-family filesystem fallback (929672a)

  • New LanceHadoopPathResolver detects non-native schemes (tbdsfs/hdfs) and downloads the dataset to a local cache via the Hadoop FileSystem before handing it to lance-core.
  • LanceOpener routes dataset opening through the resolver so it composes with read.version / read.as-of-timestamp.
  • Integration test LanceHadoopPathResolverTest.

fix: stop shading org.apache.arrow (0c52ed3)

fix: propagate hadoop config + tolerate broken latest manifest (1830644)

Test plan

Verified end-to-end in Flink 1.20 on a TBDS cluster:

  • SELECT COUNT(*) returned the expected 11 rows.
  • Scalar columns and the 512-dim ARRAY<FLOAT> vector column both read correctly (CARDINALITY(vector) = 512).

Closes #70
Closes #71
Closes #72

rockyyin added 3 commits August 27, 2026 12:49
…fs/hdfs)

Lance's Rust object_store natively supports only s3/gs/az/cos/oss/hf/file
schemes. Hadoop-family URIs (tbdsfs://, hdfs://, etc.) previously failed
with 'No object store provider found for scheme'.

This change introduces a transparent Hadoop-FileSystem-based fallback:

* New util LanceHadoopPathResolver:
  - Detect non-native schemes; pass native ones through.
  - Normalize URIs like 'scheme:/x' back to 'scheme://x' (some upstream
    code paths collapse the double slash and lose the authority).
  - Build Hadoop Configuration, injecting values from system properties
    (lance.hadoop.*) and env vars (LANCE_HADOOP_*) so TaskManagers can
    receive tbdsfs.meta etc. without core-site.xml surgery.
  - Apply tbdsfs-specific defaults: auto-derive tbdsfs.name from URI
    authority, fill fs.tbdsfs.impl if missing.
  - Download the whole dataset directory into a local cache
    ($java.io.tmpdir/lance-hadoop-cache by default) and return the
    'file://' path so lance-core can read it natively.
  - Serialize concurrent resolves for the same URI; skip re-download
    when cache already ready (detected via _versions/ subdir).
* LanceOpener.open now delegates path resolution to the resolver before
  every Dataset.open call.
* pom.xml (lance-flink-1.20): add hadoop-common as provided dependency.
* Unit tests cover scheme detection, URI normalization, native-scheme
  passthrough, Hadoop-based download via a LocalFileSystem shim, and
  cache reuse behaviour.
lance-core's Rust JNI hard-codes Arrow C Data Interface class names
(org.apache.arrow.c.jni.PrivateData, org.apache.arrow.c.Data,
org.apache.arrow.c.ArrowArray) and resolves them via FindClass() at
runtime. The maven-shade relocation of org.apache.arrow therefore
breaks the JNI bridge, failing with:
  Could not find class Lorg/apache/arrow/c/jni/PrivateData;

Remove the relocation so arrow keeps its original package names.
…st manifest

Two fixes needed to read Lance tables on tbdsfs/hdfs in YARN TaskManagers:

- Propagate flink.hadoop.* and WITH-clause hadoop.* options (e.g. tbdsfs.meta, fs.tbdsfs.impl) into the Hadoop Configuration used by LanceHadoopPathResolver, bypassing nodes whose core-site.xml is missing tbdsfs config (previously failed with 'invalid uri: /internal').

- Skip the unreadable latest-version sentinel manifest (u64::MAX-1 = 18446744073709551614.manifest), which some tbdsfs backends store corrupt and return input/output error for; Lance derives latest by scanning _versions/ so it can be safely skipped.
@github-actions github-actions Bot added the enhancement New feature or request label Aug 27, 2026
LanceHadoopPathResolver (in shared src/main/java) imports org.apache.hadoop.*. The hadoop-common dependency was only added to lance-flink-1.20/pom.xml, so the 1.18 and 1.19 modules failed to compile with 'package org.apache.hadoop.conf does not exist'. Add the same provided-scope hadoop-common dependency to both modules.
@fightBoxing
fightBoxing merged commit c5027b0 into lance-format:main Aug 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

1 participant