Skip to content

Commit

Permalink
Databricks loader: Add collector_tstamp_date column (close #943)
Browse files Browse the repository at this point in the history
  • Loading branch information
istreeter authored and voropaevp committed Jun 24, 2022
1 parent e3182ea commit a9c2482
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ object Databricks {
case Statement.EventsCopy(path, _, columns) =>
val frTableName = Fragment.const(qualifiedTableName(tgt, EventsTable.MainName))
val frPath = Fragment.const0(s"$path/output=good")
val frSelectColumns = Fragment.const0(columns.mkString(",") + ", current_timestamp() as load_tstamp")
val allColumns = columns ::: List(
"current_timestamp() AS load_tstamp",
"DATE(collector_tstamp) AS collector_tstamp_date"
)
val frSelectColumns = Fragment.const0(allColumns.mkString(","))
sql"""COPY INTO $frTableName
FROM (
SELECT $frSelectColumns from '$frPath'
Expand Down

0 comments on commit a9c2482

Please sign in to comment.