I’m trying to move my OLAP db to Hive 14. I could pretty easily just sqoop all my existing dimensions and facts out of TSQL over to Hive, however the idea is to move the data warehouse over to hive. This means I should be able to build my dimensions and facts in the cluster. The thing I’m having trouble with is porting over our dim date dimension over TSQL to Hive SQL. There are so many functions that don’t appear to be supported in Hive that this seems an insurmountable task. Has anyone created a dim date table in Hive SQL (something that calculates bank holidays, work days etc?). I could probably side step the issue and do it in Java, but if I ever left my organization then there wouldn’t be anyone to support it. Some functions that I’m struggling with…
CAST(CONVERT(CHAR(8), @Date,112) AS INT) AS DateID
Loops (WHILE Loops)
Simple Create tables. I can’t get to work. It doesn’t like the NOT NULL bits.
CREATE TEMPORARY TABLE HolidayTable
(
HolidayKey int NOT NULL,
HolidayDate timestamp NOT NULL,
HolidayName VARCHAR(50) NOT NULL,
IsUSAFedHoliday BOOLEAN NOT NULL DEFAULT (0),
IsUSABankHoliday BOOLEAN NOT NULL DEFAULT (0),
IsUSACorpHoliday BOOLEAN NOT NULL DEFAULT (0),
PRIMARY KEY (HolidayKey)
);