You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LEFT JOIN fluss_customer FOR SYSTEM_TIME AS OF o.ptimeAS c
435
+
ONo.cust_key=c.cust_key
436
+
LEFT JOIN fluss_nation FOR SYSTEM_TIME AS OF o.ptimeAS n
437
+
ONc.nation_key=n.nation_key;
437
438
```
438
439
439
440
### Real-Time Analytics on Fluss datalake-enabled Tables
@@ -459,11 +460,12 @@ SELECT snapshot_id, operation FROM datalake_enriched_orders$lake$snapshots;
459
460
460
461
**Sample Output:**
461
462
```shell
462
-
+-------------+--------------------+
463
-
| snapshot_id | operation |
464
-
+-------------+--------------------+
465
-
| 1 | append |
466
-
+-------------+--------------------+
463
+
+---------------------+-----------+
464
+
| snapshot_id | operation |
465
+
+---------------------+-----------+
466
+
| 7792523713868625335 | append |
467
+
| 7960217942125627573 | append |
468
+
+---------------------+-----------+
467
469
```
468
470
**Note:** Make sure to wait for the configured `datalake.freshness` (~30s) to complete before querying the snapshots, otherwise the result will be empty.
469
471
@@ -474,30 +476,27 @@ SELECT sum(total_price) as sum_price FROM datalake_enriched_orders$lake;
474
476
```
475
477
**Sample Output:**
476
478
```shell
477
-
+------------+
478
-
|sum_price |
479
-
+------------+
480
-
|1669519.92|
481
-
+------------+
479
+
+-----------+
480
+
| sum_price |
481
+
+-----------+
482
+
|432880.93|
483
+
+-----------+
482
484
```
483
485
484
486
To achieve results with sub-second data freshness, you can query the table directly, which seamlessly unifies data from both Fluss and Iceberg:
485
487
486
488
```sql title="Flink SQL"
487
-
-- all orders (combining fluss and iceberg data)
488
-
>SELECT*FROM datalake_enriched_orders limit2;
489
+
--to sum prices of all orders (combining fluss and iceberg data)
490
+
>SELECTsum(total_price) as sum_price FROM datalake_enriched_orders;
You can execute the real-time analytics query multiple times, and the results will vary with each run as new data is continuously written to Fluss in real-time.
@@ -509,7 +508,7 @@ docker compose exec taskmanager tree /tmp/iceberg/fluss.db
0 commit comments