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:
- 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)>]
- '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)>]
Hello,
following a recent fix of schema caching (Spark/pyspark) using the
WHERE 1=0clause in PR #4118, theRowDescriptionreturns all columns, rather than only one, queried column.Example (Python 3.12.7 using
psycopg==3.3.3) querying lesmiserables dataset:Description returns an array:
Description returns an array:
Expected:
[<Column 'name', type: varchar (oid: 1043)>]