citusdata / citusdata/citus

Recursive planning with zero columns fail

Open
#5,094 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

```SQL
CREATE TABLE test_a (id int, k int);
CREATE TABLE test_b (id int, k int);
SELECT create_distributed_table('test_a','id');
SELECT create_distributed_table('test_b','id');

SELECT *, random() FROM ( SELECT from test_a where k>1 LIMIT 1) as foo;;
ERROR: a column definition list is required for functions returning "record"
LINE 1: SELECT *, random() FROM ( SELECT from test_a where k>1 LIMI...
^
CREATE OR REPLACE VIEW v AS SELECT *, random() FROM ( SELECT from test_a where k>1 LIMIT 1) as foo;
table v;
ERROR: a column definition list is required for functions returning "record"
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the SQL statements involving create_distributed_table and the empty SELECT from test_a, then trace the recursive planning path that reports the record column-definition error. Clarify the expected behavior for a zero-column subquery before identifying the relevant planner code and adding a regression case; done means the intended query and view behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, sql
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.