Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
CREATE DYNAMIC TABLE dt_sink

PARTITIONED BY (ds)

WITH(

  --hint time partition format

  'partition.fields.ds.time-formatter' = 'yyyy-MM-dd'

)

FRESHNESS = INTERVAL '1' DAY

AS SELECT 

  ds

  id,

  order  	ds
  	id,
  	order_number,

  user  	user_id,

	...

FROM source

In the given example, both the 'source' and 'dt_sink' tables are partitioned by a 'ds' field. By specifying the format of the time partition field in the WITH clause, the framework is prompted to only refresh the data in the latest 'ds' partition with each batch schedule.

...