Skip to content

[BUG] Schema probe on a single column returns all columns #5367

Closed

Description

@LepsyMikolaj3301

Hello,
following a recent fix of schema caching (Spark/pyspark) using the WHERE 1=0 clause in PR #4118, the RowDescription returns all columns, rather than only one, queried column.

Example (Python 3.12.7 using psycopg==3.3.3) querying lesmiserables dataset:

  1. full select
>>> SELECT * FROM Character WHERE 1=0

Description returns an array:

[<Column 'name', type: varchar (oid: 1043)>, <Column '@rid', type: varchar (oid: 1043)>, <Column '@type', type: varchar (oid: 1043)>, <Column '@cat', type: "char" (oid: 18)>]
  1. 'name' Column only
>>> SELECT name FROM Character WHERE 1=0

Description returns an array:

[<Column 'name', type: varchar (oid: 1043)>, <Column '@rid', type: varchar (oid: 1043)>, <Column '@type', type: varchar (oid: 1043)>, <Column '@cat', type: "char" (oid: 18)>]

Expected: [<Column 'name', type: varchar (oid: 1043)>]

Activity

  1. self-assigned this
    on Jul 21, 2026
  2. added theissue type on Jul 21, 2026
  3. added this to the 26.8.1 milestone on Jul 21, 2026
  4. added 2 commits that reference this issue on Jul 21, 2026
  5. lvca commented on Jul 21, 2026

    @lvca
    Member

    Confirmed, thanks for the report.

    When a query returns no rows (like the WHERE 1=0 probe used by Spark/PySpark and JDBC drivers), ArcadeDB has no data to describe, so it falls back to reading the type definition to build the column metadata. That fallback looked only at the type, never at the list of columns you actually selected, so it always returned every property plus the system columns.

    Fixed in main: the column metadata is now built from the projection of the parsed query, so:

    • SELECT name FROM Character WHERE 1=0 -> name only
    • SELECT name AS hero FROM ... -> hero
    • SELECT * FROM ... and SELECT FROM ... -> all columns, as before

    A regression test covering the empty and the populated case has been added.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  6. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions