I'm trying to understand how to correctly order my...
# troubleshooting
d
I'm trying to understand how to correctly order my input data from a Postgresql Connector. Below I have a basic SQL query:
Copy code
select observed_at, measurement from database;
observed_at    | measurement 
------------------------+-------------
 2024-03-04 09:49:00+00 |    -904
 2024-03-04 09:54:00+00 |    -906
 2024-03-04 09:59:00+00 |    -905
 2024-03-04 10:04:00+00 |    -905
 2024-03-04 10:09:00+00 |    -907
 2024-03-04 10:14:00+00 |    -903
 2024-03-04 10:19:00+00 |    -907
 2024-03-04 10:24:00+00 |    -905
 2023-10-14 00:01:00+00 |    -912
 2023-10-14 00:06:00+00 |    -910
 2023-10-14 00:11:00+00 |    -914
 2023-10-14 00:16:00+00 |    -910
When I use this table as my source for a datastream I get the data in this sequence, which of course is not in order. If I add an ordering section
ORDER BY observed_at ASC
in a regular postgres query then the order is as expected. When I do this in Flink it reads and processes 745 records(out of 42000), all within the timeframe of 2024-03-04, and none of the earlier data. This is extremely confusing behavior, am I missing something obvious like the read size of the JDBC query? Should I even be using this connector for this kind of usecase? I feel like I"m missing something obvious here.
Upon deeper investigation, it seems this is due to batched vs streaming mode. I guess it's not clear to me where the 745 records limit is coming from.