citusdata / citusdata/citus

Improve run_command_on_shards to handle composite data

Open
#7,913 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

In the implementation, (`EvaluateSingleQueryResult`) the result of the query is formatted into a string. If the type of the query result is a composite type it puts `expected a single row in query result` into the text string.

```
CREATE EXTENSION IF NOT EXISTS pgstattuple;
CREATE EXTENSION IF NOT EXISTS pg_visibility;
---WORKS
SELECT * FROM run_command_on_shards('testcitus', $cmd$ SELECT pgstattuple('%s'); $cmd$);
shardid | success | result
---------+---------+------------------------------------------------
102729 | t | (16384,294,11466,69.98,15,585,3.57,2664,16.26)
102730 | t | (16384,310,12090,73.79,17,663,4.05,1872,11.43)
102731 | t | (16384,296,11544,70.46,13,507,3.09,2648,16.16)
(3 rows)

--- DOES NOT WORK
SELECT * FROM run_command_on_shards('testcitus', $cmd$ SELECT pg_visibility_map('%s'); $cmd$);
shardid | success | result
---------+---------+---------------------------------------
102589 | f | expected a single row in query result
102590 | f | expected a single row in query result
102591 | f | expected a single row in query result
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.