Open ImTangYun opened 8 months ago
window function can be used in this scenario row_number() over(partition by c3)-1 as r
window function can be used in this scenario row_number() over(partition by c3)-1 as r
I tryed and found it not possiable to use 'row_number() over(partition by c3)-1 as r' to support the same function
The biggest problem is no way to make sure the r to be the index of item in array
Spark support lateral view posexplode to explode array and get an index number of data in array, for example:
select item.a,t.r from tmp.lateral_test1 lateral view posexplode(c3) t as r,item
My table created like this:
CREATE EXTERNAL TABLE> COMMENT 'from deserializer')
tmp.lateral_test
(c3
array<structI know lateral view explode can be transformed as join lateral unnest in starrocks, but how to tansform lateral view posexplode? Also, in Trino/Prestodb Sql can be transformed as:
SELECT "t1"."item"."a" AS "a", "t1"."r" AS "r" FROM "tmp"."lateral_test1" AS "$cor0" CROSS JOIN UNNEST("$cor0"."c3") WITH ORDINALITY AS "t1" ("item", "r")
There need a way to support this feature, Thans!