Open rmoff opened 5 years ago
Note: according to #2811 (mine) this doesn't seem to work with a composite rowkey.
@rmoff I've had some trouble reproducing these workarounds in automated tests. Any examples of this?
For reference: https://github.com/peoplemerge/ksql/commit/202c0234c360c38581c7f018cde9a2ed41fccc12
We are adding FK-joins right now. Will those resolve this issue?
In general, plain re-keying of a table is semantically not a well define operation. Assume the following input table:
ID (Primary Key) | A
-----------------+-----
1 | 100
2 | 100
If we would allow PARTITION BY a
, what should the result be?
A (PK) | ID A (PK) | ID
-------+---- -------+----
100 | 1 100 | 2
The result is not well defined and thus the query is invalid.
Thoughts?
related: #2314
Consider two tables,
computer
andemployee
. We want to join them to determine which computer each employee uses (NB table-table joins are 1:1, not 1:N). Having joined them, we want to key it onMAC_ADDR
for the purposes of joining to a stream of network data.The table join is simple:
To rekey this currently requires:
More elegant / less complicated options would include:
Declare the key of the target table, KSQL would automagically rekey in the background:
Explicitly rekey the data as part of the
SELECT
:Support rekeying one table to another (only supported for streams):