pub enum TableVersion {
ForSystemTimeAsOf(Expr),
TimestampAsOf(Expr),
VersionAsOf(Expr),
Function(Expr),
Changes {
changes: Expr,
at: Expr,
end: Option<Expr>,
},
}Expand description
Specifies a table version selection, e.g. FOR SYSTEM_TIME AS OF or AT(...).
Variants§
ForSystemTimeAsOf(Expr)
When the table version is defined using FOR SYSTEM_TIME AS OF.
For example: SELECT * FROM tbl FOR SYSTEM_TIME AS OF TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR)
TimestampAsOf(Expr)
When the table version is defined using TIMESTAMP AS OF.
Databricks supports this syntax.
For example: SELECT * FROM tbl TIMESTAMP AS OF CURRENT_TIMESTAMP() - INTERVAL 1 HOUR
VersionAsOf(Expr)
When the table version is defined using VERSION AS OF.
Databricks supports this syntax.
For example: SELECT * FROM tbl VERSION AS OF 2
Function(Expr)
When the table version is defined using a function.
For example: SELECT * FROM tbl AT(TIMESTAMP => '2020-08-14 09:30:00')
Changes
Snowflake CHANGES clause for change tracking queries.
For example:
SELECT * FROM t
CHANGES(INFORMATION => DEFAULT)
AT(TIMESTAMP => TO_TIMESTAMP_TZ('...'))
END(TIMESTAMP => TO_TIMESTAMP_TZ('...'))https://docs.snowflake.com/en/sql-reference/constructs/changes
Trait Implementations§
Source§impl Clone for TableVersion
impl Clone for TableVersion
Source§fn clone(&self) -> TableVersion
fn clone(&self) -> TableVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TableVersion
impl Debug for TableVersion
Source§impl Display for TableVersion
impl Display for TableVersion
Source§impl Hash for TableVersion
impl Hash for TableVersion
Source§impl Ord for TableVersion
impl Ord for TableVersion
Source§fn cmp(&self, other: &TableVersion) -> Ordering
fn cmp(&self, other: &TableVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TableVersion
impl PartialEq for TableVersion
Source§fn eq(&self, other: &TableVersion) -> bool
fn eq(&self, other: &TableVersion) -> bool
self and other values to be equal, and is used by ==.