Skip to content

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

@kubamg

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions