Maryam
01/24/2023, 7:48 PMPartition By in the Table API and KeyBy in the DataStream API the same in terms of how they process data in streaming mode, specifically in terms of whether data is processed together in the same task slot?
Additionally, I am asking because my Top-N query seems to be producing non-deterministic results when using parallelism greater than 1.sap1ens
01/24/2023, 7:55 PMPartition By doesn’t cause a shuffle.sap1ens
01/24/2023, 8:00 PMtable.exec.sink.keyed-shuffle can help with a problem at the sink level.Maryam
01/24/2023, 9:20 PMsap1ens
01/24/2023, 9:28 PMkeyBy right after the source?Maryam
01/24/2023, 10:01 PMval table = tableEnv.fromDataStream(dataStreamSource.keyBy(id))
tableEnv.createTemporaryView("table", table)
I was hoping Partition By in SQL would do that by default. 🤔
val dedupeSqlQuery =
"""
|SELECT *
|FROM (
| SELECT *,
| ROW_NUMBER() OVER (PARTITION BY id ORDER BY processedCount DESC) AS row_num
| FROM table)
|WHERE row_num = 1
|""".stripMarginsap1ens
01/24/2023, 10:03 PMPARTITION BY is implemented for window functions. I thought you’re referring to a clause when specifying a connector table, e.g. for Kafka or object store like S3, I know for sure that doesn’t cause a shuffle.