We are trying to mask a date column for an Oracle database table using the ADDDAYS function, but when we set the "to Occurrence" parameter to 1( ), to only update the date portion. When including the "To Occurrence" parameter, we get the following error:
[pool-4-thread-1] INFO - java.lang.RuntimeException: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.sql.Timestamp (java.lang.String is in module java.base of loader 'bootstrap'; java.sql.Timestamp is in module java.sql of loader 'platform')
> at com.grid_tools.products.datamasker.masking.dbmasking.SQLUpdate.run(SQLUpdate.java:5478)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.base/java.lang.Thread.run(Unknown Source)
>Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.sql.Timestamp (java.lang.String is in module java.base of loader 'bootstrap'; java.sql.Timestamp is in module java.sql of loader 'platform')
> at com.grid_tools.products.datamasker.resolver.ResolverFunction.resolveFunction(ResolverFunction.java:2890)
> at com.grid_tools.products.datamasker.resolver.ResolverFunction.resolveFunction(ResolverFunction.java:228)
> at com.grid_tools.products.datamasker.masking.dbmasking.SQLUpdate.batchPreparedMasking(SQLUpdate.java:4177)
> at com.grid_tools.products.datamasker.masking.dbmasking.SQLUpdate.run(SQLUpdate.java:5469)
> ... 3 more
FDM 4.10.x and 4.11.x
The ADDDAYS function is working as expected. The error is thrown because of the data type used for the column is TIMESTAMP. Because the data type is timestamp, the database is expecting the format of the update to be a timestamp format. This is why we cannot use the "From Occurrence" or "To Occurrence" parameters when updating columns using the timestamp data type.
To run the masking, there are two options: