From 07c220d97cc4191e3ac8b01de64cff7c93723dbe Mon Sep 17 00:00:00 2001 From: xxchan Date: Wed, 26 Jun 2024 10:14:04 +0800 Subject: [PATCH 1/3] test: workaround include_key_as flaky test Signed-off-by: xxchan --- e2e_test/source_inline/kafka/include_key_as.slt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e_test/source_inline/kafka/include_key_as.slt b/e2e_test/source_inline/kafka/include_key_as.slt index 2258204313b0a..c25e56081285a 100644 --- a/e2e_test/source_inline/kafka/include_key_as.slt +++ b/e2e_test/source_inline/kafka/include_key_as.slt @@ -277,8 +277,8 @@ WHERE key_col IS NOT NULL query ?? -WITH arr AS (SELECT header_col_combined FROM additional_columns limit 1) -SELECT unnest(header_col_combined) FROM arr ORDER BY 1; +WITH arr AS (SELECT header_col_combined FROM additional_columns order by 1 limit 1) +SELECT unnest(header_col_combined) FROM arr; ---- (header1,"\\x7631") (header2,"\\x7632") From 39eb92411028c70b05639eaccbfcdc4d9767417d Mon Sep 17 00:00:00 2001 From: xxchan Date: Wed, 26 Jun 2024 10:24:42 +0800 Subject: [PATCH 2/3] definitely deterministic Signed-off-by: xxchan --- e2e_test/source_inline/kafka/include_key_as.slt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/e2e_test/source_inline/kafka/include_key_as.slt b/e2e_test/source_inline/kafka/include_key_as.slt index c25e56081285a..57b80003fbe60 100644 --- a/e2e_test/source_inline/kafka/include_key_as.slt +++ b/e2e_test/source_inline/kafka/include_key_as.slt @@ -277,11 +277,12 @@ WHERE key_col IS NOT NULL query ?? -WITH arr AS (SELECT header_col_combined FROM additional_columns order by 1 limit 1) -SELECT unnest(header_col_combined) FROM arr; +WITH arr AS (SELECT header_col_combined FROM additional_columns), +unnested AS (SELECT unnest(header_col_combined) FROM arr) +select *, count(*) from unnested group by 1; ---- -(header1,"\\x7631") -(header2,"\\x7632") +(header1,"\\x7631") 101 +(header2,"\\x7632") 101 query ???? select header_col_1, header_col_2, header_col_3, header_col_4 from additional_columns limit 1 From 97397eb0548e6b3daf99ffc5e5858036303a1dc6 Mon Sep 17 00:00:00 2001 From: xxchan Date: Wed, 26 Jun 2024 10:27:17 +0800 Subject: [PATCH 3/3] ultimately deterministic & why bother 101 messages? Signed-off-by: xxchan --- e2e_test/source_inline/kafka/include_key_as.slt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e_test/source_inline/kafka/include_key_as.slt b/e2e_test/source_inline/kafka/include_key_as.slt index 57b80003fbe60..919e47bbb4248 100644 --- a/e2e_test/source_inline/kafka/include_key_as.slt +++ b/e2e_test/source_inline/kafka/include_key_as.slt @@ -184,7 +184,7 @@ rpk topic create 'test_additional_columns' # Note: `sh` doesn't have {..} brace expansion system ok -bash -c 'for i in {0..100}; do echo "key\$i:{\\"a\\": \$i}" | rpk topic produce test_additional_columns -f "%k:%v\\n" -H "header1=v1" -H "header2=v2"; done' +bash -c 'for i in {0..10}; do echo "key\$i:{\\"a\\": \$i}" | rpk topic produce test_additional_columns -f "%k:%v\\n" -H "header1=v1" -H "header2=v2"; done' statement error @@ -273,16 +273,16 @@ WHERE key_col IS NOT NULL AND timestamp_col IS NOT NULL AND header_col_combined IS NOT NULL ---- -101 +11 query ?? WITH arr AS (SELECT header_col_combined FROM additional_columns), unnested AS (SELECT unnest(header_col_combined) FROM arr) -select *, count(*) from unnested group by 1; +select *, count(*) from unnested group by 1 order by 1; ---- -(header1,"\\x7631") 101 -(header2,"\\x7632") 101 +(header1,"\\x7631") 11 +(header2,"\\x7632") 11 query ???? select header_col_1, header_col_2, header_col_3, header_col_4 from additional_columns limit 1