Ich versuche, Daten in eine Hive Tabellenpartition mit zu laden.Partition Spalt gleich aktuelles Datum in Hive
Der Code ist wie folgt:
CREATE EXTERNAL TABLE URL(url STRING, clicks INT)
COMMENT 'Unique Clicks per URL'
PARTITIONED BY(dt STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/mypath/URL';
LOAD DATA INPATH '/inputpath/' INTO TABLE URL
PARTITION (dt=date_format(CURRENT_TIMESTAMP, "yyyy.MM.dd HH:mm:ss"));
ich folgende Fehlermeldung bin Gettin:
FAILED: ParseException line 4:14 cannot recognize input near
'date_format' '(' 'CURRENT_TIMESTAMP' in constant
Ich versuchte
mitSET hive.exec.dynamic.partition.mode=nonstrict;
aber nichts geändert.
Warum funktioniert es nicht? Wie setze ich das aktuelle Datum als Partitionsspalte?
Vielen Dank im Voraus.
Lorenzo
Es war sehr frustrierend Ihre Frage zu beantworten. Ich schlage vor, dass Sie einige Dokumentationen/Tutorials lesen, bevor Sie mit der Arbeit an Hive fortfahren. –