Home > Back-end >  Flink how to use row_number in the group window, scene for stream processing
Flink how to use row_number in the group window, scene for stream processing

Time:11-09

Flink how to use in the group window row_number, scene for stream processing

The following SQL, the error, according to the error I removed row_number and left after the join to join is no problem,
Is the row_number Fllink can only be used in dealing with the flow in the Top - N scene?
Novice to solve

 

INSERT INTO sink_print
Select
TUMBLE_END proctime, INTERVAL (' 1 'Day as pt,
To_date (t.a ction_time, '- dd yyyy - MM) as action_date,
T.s ource as source,
Tc ountrycode as countrycode,
Todd Harper MSR as HMSR,
Count (distinct t.u id) as metric_value,
1002 as metric_id,
1 as hours,
T.s ite
The from
(
The select t.a ction_time, t.u id, tc id, Todd Harper MSR, tc ountrycode, t.s ource, t.s ite
ROW_NUMBER () over (partition by tc id order by TO_TIMESTAMP (t.a ction_time, "yyyyMMddHHmmss") desc) fairly rk, t1. Join_req_dt, t.p roctime
The from
Dwr_app_log t
Left the join dwr_tb_ms_thrd_cust t1
On t.u id=t1. Cust_id
Where
T.u id is not null
And t.s ite is not null
And to_date (t.a ction_time, '- dd yyyy - MM)=to_date (cast (t1) join_req_dt as string),' - dd yyyy - MM)
And t.p latform='GSHOPPER'

) t

Where t.r k=1
Group by
TUMBLE (proctime, INTERVAL '1' Day), to_date (t.a ction_time, '- dd yyyy - MM), Todd Harper MSR, tc ountrycode, t.s ource, t.s ite



Error:
 
The Exception in the thread "main" org. Apache. Flink. Table. API. TableException: GroupWindowAggregate doesn 't support consuming, update and delete changes which is produced by the node Rank (strategy=[UndefinedStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=(cid), orderBy=[$DESC 9], the select=[cid, action_time, source, countrycode, HMSR, site, uid, proctime, $9])
The at org. Apache. Flink. Table. Planner. Plan. Optimize. The program. The FlinkChangelogModeInferenceProgram $SatisfyModifyKindSetTraitVisitor. CreateNewNode (FlinkChangelogModeInferenceProgram. Scala: 355)
The at org. Apache. Flink. Table. Planner. Plan. Optimize. The program. The FlinkChangelogModeInferenceProgram $SatisfyModifyKindSetTraitVisitor. Visit (FlinkChangelogModeInferenceProgram. Scala: 207)
The at org.apache.flink.table.planner.plan.optimize.program.FlinkChangelogModeInferenceProgram$SatisfyModifyKindSetTraitVisitor.org $$$table flink apache $planner $$$$$SatisfyModifyKindSetTraitVisitor FlinkChangelogModeInferenceProgram program optimize plan $$visitChild (FlinkChangelogModeInferenceProgram. Scala: 314)
The at org. Apache. Flink. Table. Planner. Plan. Optimize. The program. The FlinkChangelogModeInferenceProgram $SatisfyModifyKindSetTraitVisitor $$anonfun $3. Apply (FlinkChangelogModeInferenceProgram. Scala: 303)
The at org. Apache. Flink. Table. Planner. Plan. Optimize. The program. The FlinkChangelogModeInferenceProgram $SatisfyModifyKindSetTraitVisitor $$anonfun $3. Apply (FlinkChangelogModeInferenceProgram. Scala: 302)
At the scala. Collection. TraversableLike $$anonfun $map $1. Apply (TraversableLike. Scala: 234)
At the scala. Collection. TraversableLike $$anonfun $map $1. Apply (TraversableLike. Scala: 234)


  • Related