Get new records from dataview
ramik_allakhverdiev
Vertica Customer
Hello Dears,
Maybe someone can suggest me, here is the use case.
We are using ETL tool to pull out records from Vertica and push them to salesforce and looking for a solution on how to get only new records in Vertica which were recently added into table let's say 1 day back or during a week and get only those records not others. is there an option to do it via query?
Just to give an overview of data looks like
Maybe a newest created rows then pick them and return to our ETL for next updates to salesforce
Thank you in advance !
Tagged:
0
Best Answer
-
VValdar Vertica Employee Employee
Hi ramik_allakhverdiev,
Well that would be a basic filter:
select * from MyTable where greatest(etl_created_at, etl_updated_at)::date >= current_date - 1 and greatest(etl_created_at, etl_updated_at)::date < current_date;
1
Answers
Hello,
To get the recent data fetched from the Vertica source, you can use a filter in the source query based on the etl_created_at or etl_updated_at columns.
The filter criteria depends on the frequency of the workflow execution. For example, if the workflow executes daily you can use the filter etl_created_at >= sysdate -1
You can modify the sysdate -1 criteria by getting it in different formats such as YYYY-MM-DD or DD-MM-YYYY
Thanks
Shahzeb
Lightweight partition copy increases performance by initially sharing the same storage between two tables.
If you call COPY_PARTITIONS_TO_TABLE and the target table does not exist, the function creates the table automatically.
See: https://www.vertica.com/docs/12.0.x/HTML/Content/Authoring/SQLReferenceManual/Functions/VerticaFunctions/PartitionManagement/COPY_PARTITIONS_TO_TABLE.htm