[Bug] orca incorrectly executes functions on QD
Maintainer thường phản hồi trong vòng 2 ngày
@aviralgarg05 đang làm issue này rồi.
Từ ngày 10/4/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Apache Cloudberry version
main
What happened
-- change /home/gpadmin/cloudberry/src/test/regress/regress.so to your local path
CREATE FUNCTION test_enc_conversion(bytea, name, name, bool, validlen OUT int, result OUT bytea)
AS '**/home/gpadmin/cloudberry/src/test/regress/regress.so**', 'test_enc_conversion'
LANGUAGE C STRICT;
create or replace function test_conv(
input IN bytea,
src_encoding IN text,
dst_encoding IN text,
result OUT bytea,
errorat OUT bytea,
error OUT text)
language plpgsql as
$$
declare
validlen int;
begin
-- First try to perform the conversion with noError = false. If that errors out,
-- capture the error message, and try again with noError = true. The second call
-- should succeed and return the position of the error, return that too.
begin
select * into validlen, result from test_enc_conversion(input, src_encoding, dst_encoding, false);
errorat = NULL;
error := NULL;
exception when others then
error := sqlerrm;
select * into validlen, result from test_enc_conversion(input, src_encoding, dst_encoding, true);
errorat = substr(input, validlen + 1);
end;
return;
end;
$$;
CREATE TABLE utf8_verification_inputs (inbytes bytea, description text PRIMARY KEY);
insert into utf8_verification_inputs values
('\x66006f', 'NUL byte'),
('\xaf', 'bare continuation'),
('\xc5', 'missing second byte in 2-byte char'),
('\xc080', 'smallest 2-byte overlong'),
('\xc1bf', 'largest 2-byte overlong'),
('\xc280', 'next 2-byte after overlongs'),
('\xdfbf', 'largest 2-byte'),
('\xe9af', 'missing third byte in 3-byte char'),
('\xe08080', 'smallest 3-byte overlong'),
('\xe09fbf', 'largest 3-byte overlong'),
('\xe0a080', 'next 3-byte after overlong'),
('\xed9fbf', 'last before surrogates'),
('\xeda080', 'smallest surrogate'),
('\xedbfbf', 'largest surrogate'),
('\xee8080', 'next after surrogates'),
('\xefbfbf', 'largest 3-byte'),
('\xf1afbf', 'missing fourth byte in 4-byte char'),
('\xf0808080', 'smallest 4-byte overlong'),
('\xf08fbfbf', 'largest 4-byte overlong'),
('\xf0908080', 'next 4-byte after overlong'),
('\xf48fbfbf', 'largest 4-byte'),
('\xf4908080', 'smallest too large'),
('\xfa9a9a8a8a', '5-byte');
-- Test UTF-8 verification slow path
select description, (test_conv(inbytes, 'utf8', 'utf8')).* from utf8_verification_inputs;
ERROR: query plan with multiple segworker groups is not supported
HINT: likely caused by a function that reads or modifies data in a distributed table
CONTEXT: PL/pgSQL function test_conv(bytea,text,text) line 8 during statement block entry
postgres=# explain select description, (test_conv(inbytes, 'utf8', 'utf8')).* from utf8_verification_inputs;
QUERY PLAN
---------------------------------------------------------------------------------------
Result (cost=0.00..431.00 rows=1 width=32)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=16)
-> Seq Scan on utf8_verification_inputs (cost=0.00..431.00 rows=1 width=16)
Optimizer: GPORCA
(4 rows)
postgres=# set optimizer = off;
SET
postgres=# explain select description, (test_conv(inbytes, 'utf8', 'utf8')).* from utf8_verification_inputs;
QUERY PLAN
---------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..9314.00 rows=34800 width=128)
-> Seq Scan on utf8_verification_inputs (cost=0.00..8850.00 rows=11600 width=128)
Optimizer: Postgres query optimizer
(3 rows)
It seems that ORCA executes functions on QD, but PG executes them directly on QE.
What you think should happen instead
No response
How to reproduce
see before
Operating System
rockylinux
Anything else
No response
Are you willing to submit PR?
- Yes, I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct.
- Ngôn ngữ chính
- C
- Star
- 1.4k
- Fork
- 248
- Merge trung bình
- 4 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 39
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudberry
-
type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/cloudberry#1885 · 2 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
apache/cloudberry#1825 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
type: Bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
apache/cloudberry#2048 · 5 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
type: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 40/100
apache/cloudberry#2047 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
type: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
apache/cloudberry#2046 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/cloudberry
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
[Issue]: Headers - vx_ext_amd.h does not compile as C (enum types used without the enum keyword)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Qiskit/qiskit#17079 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày