Repository navigation
CometScanRule reads fs.comet.libhdfs.schemes from SQLConf, but native reads it from the Hadoop conf #6837
Description
Describe the bug
CometScanRule and native Parquet scans read fs.comet.libhdfs.schemes from different places, so the rule can decide a scheme is or is not served by libhdfs differently from native.
- The rule reads
COMET_LIBHDFS_SCHEMES, the SQLConf entryspark.hadoop.fs.comet.libhdfs.schemes, defaulting tohdfs. It uses that list to classify the scan's root paths, for the "Unsupported filesystem schemes" gate, and to skip the object_store path probe for libhdfs paths. - Native gets the list from the Hadoop conf:
NativeConfigforwardshadoopConf.get("fs.comet.libhdfs.schemes")to the scan's object store options, andis_hdfs_scheme(parquet_support.rs) routes a scheme through libhdfs only when it is in that option, or ishdfswhen the option is absent. fs.comet.s3Compliant.schemesis already read from the Hadoop conf in the same method, socore-site.xmlis honored for it but not for the libhdfs list.
The two disagree in both directions:
- Set only in
core-site.xml(or another Hadoop-only source), e.g.fs.comet.libhdfs.schemes=hdfs,webhdfs. Native would readwebhdfs://through libhdfs, but the rule does not see the list, so the scan falls back to Spark with "Unsupported filesystem schemes: webhdfs". - Set at runtime with
SET spark.hadoop.fs.comet.libhdfs.schemes=hdfs,webhdfs. Spark'sSessionState.newHadoopConfcopies SQLConf keys as they are, without dropping thespark.hadoop.prefix, so the Hadoop conf has nofs.comet.libhdfs.schemes. The rule admits the scan, native does not routewebhdfsthrough libhdfs, and the scan fails at execution when object_store rejects the URL ("Unable to recognise URL").
Steps to reproduce
- Put
fs.comet.libhdfs.schemes=hdfs,webhdfsincore-site.xml, enable the native Parquet scan, and read Parquet files from awebhdfs://path. The scan falls back with "Unsupported filesystem schemes: webhdfs". - Without it in
core-site.xml, runSET spark.hadoop.fs.comet.libhdfs.schemes=hdfs,webhdfsin the session and read the same path. Comet claims the scan, and the query fails when native opens the file.
Expected behavior
The rule uses the same libhdfs list native will use: read it from the scan's Hadoop conf (newHadoopConfWithOptions(relation.options)), as fs.comet.s3Compliant.schemes already is. Then case 1 runs natively and case 2 falls back instead of failing.
Additional context
Found in #6753 (comment), which moves the multi-store fallback check in the same method to the Hadoop conf list. The root classification and the scheme gate stay on SQLConf there, since changing them changes which scans Comet claims.
A list set in the Spark conf at startup (spark.hadoop.fs.comet.libhdfs.schemes) reaches both places, so the common setup is not affected.
Willingness to contribute
I can contribute a fix for this bug independently
Activity
dwsmith1983 commentedon Oct 10, 2026
take