forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
51390: importccl: support DEFAULT columns for current timestamp functions (like now()) for IMPORT INTO r=Anzoteh96 a=Anzoteh96 This PR follows up from cockroachdb#50295 to add support for functions concerning current time as default expression. The functions supported are: `current_date()`, `current_timestamp()`, `localtimestamp()`, `now()`, `statement_timestamp()`, `timeofday()`, `transaction_timestamp()`. These functions have values that stay the same throughout different rows of an IMPORT: they record the transaction timestamp. Notice that `clock_timestamp()`is not supported as it records the time of a row being inserted, and therefore varies through different rows of an IMPORT. This is achieved by injecting the walltime recorded at `importCtx` into evalCtx required for the evaluation of these functions. In addition, this PR also uses a visitor method to determine whether a default expression is supported by IMPORT INTO. Specifically, it checks that all function expressions (and arguments) of the default expression, when represented as a tree, contain either immutable expressions or functions we support. Partially addresses cockroachdb#48253. Release note (general change): current timestamp functions are now supported by IMPORT INTO. Co-authored-by: anzoteh96 <[email protected]>
- Loading branch information
Showing
3 changed files
with
287 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.