Skip to content

[BUG] Postgres Protocol Plugin does not return schema for empty query results #3971

Description

@kubamg

Hi,
I have been trying to connect to locally deployed arcade db with pyspark using postgres JDBC driver and faced an interesting problem. While executing simple queries (e.g. SELECT id FROM table on a non-empty table with valid column id), I would get empty results. However, when checking the count of the dataframe loaded by pyspark, it returns a correct number of rows in the table. Showing the dataframe content displays N empty rows.

I have researched this for a while, and figured out that spark queries the database by adding WHERE 1=0 to the query to retrieve data schema. On regular postgres database, this does not return any rows, but the schema is returned. For example:

Image

In arcade db, nothing is returned:

Image

Activity

  1. robfrank commented on Apr 23, 2026

    @robfrank
    Collaborator

    I faced this problem in the past (like 10 years ago), same old story: To obtain the schema spark/pyspark perform a first query and caches the schema.

    We can work on compatibility with spark/pyspark.
    I take this issue.

  2. self-assigned this
    on Apr 23, 2026
  3. added this to the 26.5.1 milestone on Apr 23, 2026
  4. added theissue type on Apr 23, 2026
  5. added a commit that references this issue on May 6, 2026
  6. added a commit that references this issue on May 10, 2026
  7. added a commit that references this issue on May 12, 2026
  8. added 2 commits that reference this issue on Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions