)

Advertisement

Ad code

Fabric - See history of parquet files

One advantage with parquet files is that it keeps history. Run the below script and it will give you the history. 
%%sql

DESCRIBE HISTORY dirpartytable;

Below is an example I have in my environment.


Use "VERSION AS OF" 

Now that you have the history, you can use the VERSION AS OF statement. This will give you the previous values for the record. 
%%sql

SELECT partynumber, primarycontactphone, primarycontactemail FROM dirpartytable WHERE partynumber = '000001702';
SELECT partynumber, primarycontactphone, primarycontactemail FROM dirpartytable VERSION AS OF 2 WHERE partynumber = '000001702';

The below example is when I deleted the primary contact phone number.



One advantage with parquet files is that it keeps history. Run the below script and it will give you the history. 
%%sql

DESCRIBE HISTORY dirpartytable;

Below is an example I have in my environment.


Use "VERSION AS OF" 

Now that you have the history, you can use the VERSION AS OF statement. This will give you the previous values for the record. 
%%sql

SELECT partynumber, primarycontactphone, primarycontactemail FROM dirpartytable WHERE partynumber = '000001702';
SELECT partynumber, primarycontactphone, primarycontactemail FROM dirpartytable VERSION AS OF 2 WHERE partynumber = '000001702';

The below example is when I deleted the primary contact phone number.



One advantage with parquet files is that it keeps history. Run the below script and it will give you the history. 
%%sql

DESCRIBE HISTORY dirpartytable;

Below is an example I have in my environment.


Use "VERSION AS OF" 

Now that you have the history, you can use the VERSION AS OF statement. This will give you the previous values for the record. 
%%sql

SELECT partynumber, primarycontactphone, primarycontactemail FROM dirpartytable WHERE partynumber = '000001702';
SELECT partynumber, primarycontactphone, primarycontactemail FROM dirpartytable VERSION AS OF 2 WHERE partynumber = '000001702';

The below example is when I deleted the primary contact phone number.



Post a Comment

0 Comments

Comments