We have a requirement to publish a report for all the user updates for the day. This should include all the attributes that have been updated (old + new values) along with other user attributes. We try to read the blob data from the userhistroy table through sql query we are unable to convert blob data to normal state like user readable format.
We came with an approach to use custom jar for achieving the above requirement. custom jar used to update store and read blob data from user history. We can then run analytics query against the converted data to provide required reports Below is flow of the custom jar and various objects/comments involved in the solution.
Due to the possibility of updatehistory containing large amount of data & attempting to convert and store it to temp table might result in performance issue on DB there is the following check in place:
If username=all then numberofdays should be = 1
If username=all and numberofdays =0 then the days difference between startdate and enddate should be =1
Recommended to retrieve small amounts of data at a time.
The usershistory_plain table is truncated after every run on the job.