How to say to Hive expand TEMPORARY MACRO into a permanent VIEW?

Viewed 32

Is possible to use TEMPORARY MACRO into CREATE VIEW? I need to use a kind of precompiler to expand macros and save the code as a permanent VIEW. Example:

CREATE TEMPORARY MACRO to_isodate(d string)
       CONCAT_WS('-',substr(d,1,4),substr(d,5,2),substr(d,7));
CREATE VIEW vw1 AS SELECT id, to_isodate(d1) d1, to_isodate(d2) d2 FROM t;

... after session logout use the VIEW vw1.

0 Answers
Related