Skip to content

Lookup join example is potentially wrong #5

@xjmdoo

Description

@xjmdoo

Hi,

I'm going through the book and I think the lookup join query is incorrect.

SELECT
    transactionId,
    t.accountId,
    t.eventTime_ltz,
    TO_TIMESTAMP_LTZ(updateTime, 3) AS updateTime,
    type,
    amount,
    balance,
    districtId,
    frequency
FROM transactions AS t
    JOIN accounts FOR SYSTEM_TIME AS OF t.eventTime_ltz AS a
    ON t.accountId = a.accountId;

As it is mentioned in the intro, a processing time attribute is required, however, in the example an event time field is used. On the Flink Dashboard it is also visible that the executed query is doing a temporal join. Switching to a field which is defined as PROCTIME() turns the query into a lookup join.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions