Skip to content

GeoParquet reader gives an unhelpful error when no path is given or the path has no files #3411

Description

@jiayuasu

spark.read.format("geoparquet").load(None) in PySpark (which calls the JVM load() with no paths), .load() in Scala, and reading an existing directory that contains no files all fail with:

[UNABLE_TO_INFER_SCHEMA] Unable to infer schema for GeoParquet. It must be specified manually.

The message does not point at the actual cause, a missing or None path. That is easy to hit when an upstream step returns None for "no results" and the value is passed straight to load().

Spark removes the path option before it calls FileFormat.inferSchema and only passes the list of files it found, so the reader cannot tell a missing path from an empty directory: both arrive as an empty file list.

Proposal

When there are no input files, raise an AnalysisException whose message names both causes and the fixes: pass a path to GeoParquet files, or specify the schema. Reads with a user-specified schema, and globs that match nothing (which already fail with PATH_NOT_FOUND), stay as they are.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions