You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
When PG calls parquetReScanForeignScan(), this eventually calls one of:
DefaultParquetReader::rescan()
CachingParquetReader::rescan()
Both of the above reinitialize:
this->row_group = 0;
This assignment should be -1, similarly to how this->row_group is initialized in the constructor of these classes.
This is because on the first call to next(), this->row_group will be immediately incremented.
The way this->row_group is currently assigned to 0, causes the first call to next() to increment it to 1, and the whole first row group will not be read, leading to wrong query result.
parquetReScanForeignScan() itself is called by PG in nested-loop joins, when the parquet_fdw's foreign table is on the inner side of the loop.
I checked that changing both functions to do:
this->row_group = -1;
fixes the issue in my examples.
Thanks,
jk
The text was updated successfully, but these errors were encountered:
Hi,
When PG calls parquetReScanForeignScan(), this eventually calls one of:
DefaultParquetReader::rescan()
CachingParquetReader::rescan()
Both of the above reinitialize:
this->row_group = 0;
This assignment should be -1, similarly to how this->row_group is initialized in the constructor of these classes.
This is because on the first call to next(), this->row_group will be immediately incremented.
The way this->row_group is currently assigned to 0, causes the first call to next() to increment it to 1, and the whole first row group will not be read, leading to wrong query result.
parquetReScanForeignScan() itself is called by PG in nested-loop joins, when the parquet_fdw's foreign table is on the inner side of the loop.
I checked that changing both functions to do:
this->row_group = -1;
fixes the issue in my examples.
Thanks,
jk
The text was updated successfully, but these errors were encountered: