So the question is ¿what could be the best way to get the last record from a big external table hosted on Synapse Serverless pool?
This table has a column key that works as a primary key and also has another timestamp column, for example:
col_key | col_a | col_b | col_date
a1 val1 val2 2018-03-05T18:24:40.228+00:00
a1 val10 val2 2018-03-06T18:24:40.228+00:00
a1 val12 val29 2018-03-07T18:24:40.228+00:00
a2 val1 val2 2018-03-04T18:24:40.228+00:00
a2 val1 val2 2018-03-05T18:24:40.228+00:00
a2 val1 val42 2018-03-09T18:24:40.228+00:00
a3 val1 val2 2018-03-05T18:24:40.228+00:00
a3 val1 val9 2018-03-07T18:24:40.228+00:00
a3 val1 val32 2018-03-08T18:24:40.228+00:00
so the query will return a compacted table:
col_key | col_a | col_b | col_date
a1 val12 val29 2018-03-07T18:24:40.228+00:00
a2 val1 val42 2018-03-09T18:24:40.228+00:00
a3 val1 val32 2018-03-08T18:24:40.228+00:00
it can not use spark; ¿what kind of optimized query with good performance can be used?