Interface TableAsofJoinStep<R extends Record>


public interface TableAsofJoinStep<R extends Record>
An intermediate type for the construction of an ASOF JOIN clause, where a match condition must be added using match(Condition) (corresponding to e.g. the MATCH_CONDITION clause in Snowflake, or MATCH in Trino).

The match condition must be a single comparison predicate of the form [lhs expression] [comparator] [rhs expression], where [comparator] is any of <, <=, >, >=. It specifies which row is the "nearest" row from the right hand side for each row of the left hand side:

  • > or >=: The row with the greatest [rhs expression] that is still less than (or equal to) [lhs expression].
  • < or <=: The row with the least [rhs expression] that is still greater than (or equal to) [lhs expression].

Additional (usually equality) predicates can be supplied using ON or USING after the match condition.

Referencing XYZ*Step types directly from client code

It is usually not recommended to reference any XYZ*Step types directly from client code, or assign them to local variables. When writing dynamic SQL, creating a statement's components dynamically, and passing them to the DSL API statically is usually a better choice. See the manual's section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.

Drawbacks of referencing the XYZ*Step types directly:

  • They're operating on mutable implementations (as of jOOQ 3.x)
  • They're less composable and not easy to get right when dynamic SQL gets complex
  • They're less readable
  • They might have binary incompatible changes between minor releases
Author:
Lukas Eder