You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE tmp.tangyun_test6( day string, uid bigint, vm_postcount int, time bigint)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
data for tmp.tangyun_test6: test6_data_orc.log
set sql_dialect='trino';
SELECT "t3"."day" AS "DAY", "t3"."agency_uid" AS "agency_uid", "t10"."post_credit" AS "post_credit"
FROM (SELECT "day", "agency_uid"
FROM (SELECT "day", "agency_uid"
FROM "tmp"."tangyun_test4") AS "t0"
GROUP BY "day", "agency_uid") AS "t3"
LEFT JOIN (SELECT "day", CASE WHEN "uid" IS NOT NULL THEN CAST("uid" AS VARCHAR(65535)) ELSE CAST('all' AS VARCHAR(65535)) END AS "uid", SUM("$f2") AS "post_credit"
FROM (SELECT "day", "uid", CASE WHEN (ROW_NUMBER() OVER (PARTITION BY "uid", "day" ORDER BY "time" DESC)) = 1 THEN "vm_postcount" ELSE 0 END AS "$f2"
FROM "tmp"."tangyun_test6") AS "t5"
GROUP BY GROUPING SETS(("day", "uid"), "day")) AS "t10" ON "t3"."day" = "t10"."day" AND "t3"."agency_uid" = "t10"."uid"
Steps to reproduce the behavior (Required)
createtab_stmt
CREATE TABLE
tmp.tangyun_test4
(day
string,agency_uid
varchar(65535),_col0
bigint)ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
data for tmp.tangyun_test4:
test4_data_orc.log
CREATE TABLE
tmp.tangyun_test6
(day
string,uid
bigint,vm_postcount
int,time
bigint)ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
data for tmp.tangyun_test6:
test6_data_orc.log
set sql_dialect='trino';
SELECT "t3"."day" AS "DAY", "t3"."agency_uid" AS "agency_uid", "t10"."post_credit" AS "post_credit"
FROM (SELECT "day", "agency_uid"
FROM (SELECT "day", "agency_uid"
FROM "tmp"."tangyun_test4") AS "t0"
GROUP BY "day", "agency_uid") AS "t3"
LEFT JOIN (SELECT "day", CASE WHEN "uid" IS NOT NULL THEN CAST("uid" AS VARCHAR(65535)) ELSE CAST('all' AS VARCHAR(65535)) END AS "uid", SUM("$f2") AS "post_credit"
FROM (SELECT "day", "uid", CASE WHEN (ROW_NUMBER() OVER (PARTITION BY "uid", "day" ORDER BY "time" DESC)) = 1 THEN "vm_postcount" ELSE 0 END AS "$f2"
FROM "tmp"."tangyun_test6") AS "t5"
GROUP BY GROUPING SETS(("day", "uid"), "day")) AS "t10" ON "t3"."day" = "t10"."day" AND "t3"."agency_uid" = "t10"."uid"
Expected behavior (Required)
------------+------------+-------------
2024-11-25 | 3834442359 | 1749945
2024-11-25 | 3848292872 | 90655
2024-11-25 | all | 1840600
Real behavior (Required)
------------+------------+-------------
2024-11-25 | 3848292872 | 90655
2024-11-25 | 3834442359 | 1749945
2024-11-25 | all | 1749945
2024-11-25 | all | 90655
StarRocks version (Required)
3.3.7
The text was updated successfully, but these errors were encountered: