FLISS Sabrine
FLISS Sabrine

Reputation: 11

Event-Time Temporal Table Join requires both primary key and row time attribute in versioned table, but no row time attribute can be found

I have tried to use lookup join but i find this problem:

SELECT
>   e.isFired,
>   e.eventMrid,
>     e.createDateTime,
>   r.id AS eventReference_id,
>     r.type
> FROM Event e
> JOIN EventReference FOR SYSTEM_TIME AS OF e.createDateTime AS r
>   ON r.id = e.eventReference_id;

[ERROR] Could not execute SQL statement. Reason: org.apache.flink.table.api.ValidationException: Event-Time Temporal Table Join requires both primary key and row time attribute in versioned table, but no row time attribute can be found.

Upvotes: 0

Views: 1566

Answers (1)

David Anderson
David Anderson

Reputation: 43697

Whether that query will be interpreted by the Flink SQL planner as a temporal join or a lookup join depends on the type of the table on the right-hand side. In this case I guess you haven't used a lookup source. And your time attribute might not be defined correctly.

Temporal (time-versioned) joins require

  • an equality predicate on the primary key of the versioned table
  • a time attribute

and lookup joins require

  • a lookup source connector, (e.g., JDBC, HBase, Hive, or something custom)
  • an equality join predicate
  • using a processing time attribute in combination with FOR SYSTEM_TIME AS OF (to prevent needing to update the join results)

Upvotes: 2

Related Questions