I wonder how to go about creating an expression in Java that takes a date variable formatted as "1999-12-30 12:34:45" and converts it to an Int holding "19991230".
This is probably something others would appreciate, especially people extracting and cleaning up data for loading into a Data Warehouse.
My guess is one need to change date pattern, convert to string, truncate first part (8 chars) and convert to int.
Ideas?
(update) My bad in explaining the issue. The resulting int will service as a key/Fk id to a Date Dimension. A similar operation should be done for creating a key to a Time-of-Day Dimension. The int will reduce the size consumed in the facts table, in which these int keys would be stored. See related answer: https://stackoverflow.com/a/8416548/1132571