Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when create pathkey for sorted option in UNION query #86

Open
MinhLA1410 opened this issue Jun 12, 2024 · 1 comment
Open

Crash when create pathkey for sorted option in UNION query #86

MinhLA1410 opened this issue Jun 12, 2024 · 1 comment

Comments

@MinhLA1410
Copy link
Contributor

CREATE FOREIGN TABLE example1 (
    one     INT8,
    two     INT8[],
    three   TEXT,
    four    TIMESTAMP,
    five    DATE,
    six     BOOL,
    seven   FLOAT8)
SERVER parquet_srv
OPTIONS (filename '/tmp/data_local/data/simple/example1.parquet', sorted 'one');

CREATE FOREIGN TABLE example2 (
    one     INT8,
    two     INT8[],
    three   TEXT,
    four    TIMESTAMP,
    five    DATE,
    six     BOOL,
    seven   FLOAT8)
SERVER parquet_srv
OPTIONS (filename '/tmp/data_local/data/simple/example2.parquet', sorted 'one');

postgres=# SELECT 1 AS type,one FROM example1 UNION ALL SELECT 2 AS type,one FROM example2 ORDER BY type,one;
 type | one 
------+-----
    1 |   1
    1 |   2
    1 |   3
    1 |   4
    1 |   5
    1 |   6
    2 |   1
    2 |   3
    2 |   5
    2 |   7
    2 |   9
(11 rows)

postgres=# SELECT 1 AS type,one FROM example1 UNION ALL SELECT 2 AS type,one FROM example2 ORDER BY type;
TRAP: FailedAssertion("rel->reloptkind == RELOPT_BASEREL || rel->reloptkind == RELOPT_DEADREL", File: "equivclass.c", Line: 760, PID: 2418941)
postgres: vagrant postgres [local] SELECT(ExceptionalCondition+0xb9)[0xb1fb37]
postgres: vagrant postgres [local] SELECT(get_eclass_for_sort_expr+0x51b)[0x82d880]
postgres: vagrant postgres [local] SELECT[0x83f42b]
postgres: vagrant postgres [local] SELECT(build_expression_pathkey+0xdf)[0x840202]
/home/vagrant/workplace/version_postgres/postgresql-15.0/PGS/lib/parquet_fdw.so(parquetGetForeignPaths+0x4d9)[0x7fe78939d8e9]
@za-arthur
Copy link
Contributor

Thank you for the report.

The issue should be solved by the PR #66. I didn't merge it yet because there is another case when it crashes, although it shouldn't be related with the PR itself, I think there is a bug related to that query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants