Я надеюсь, что вы можете помочь
Я пытаюсь создать приведенную ниже таблицу, разделенную на dt, но она каждый раз выдает ошибку, и я не могу найти правильный способ сделать это.
Я использую улей
Любая помощь была бы удивительной:)
Спасибо
CREATE TABLE keenek1.ipfr_cf2
AS
SELECT
CASE
WHEN catreputation = 1 THEN 'Clean Site'
WHEN catreputation = 2 THEN 'Unknown Site'
WHEN catreputation = 3 THEN 'Potentially Dangerous or Affiliated to a dangerous site'
WHEN catreputation = 4 THEN 'Malicious Site'
ELSE 'other'
END as urlcatrating,
dt, hh, count(distinct(emsisdn)) as emsisdncount, sum(bytesdl) as download, sum(bytesul) as upload, count(*) as transactions,
catid, catreputation, catgrpid, serverport, urlsetmatched, urlsetprivate, responderaction, shield_status
FROM udsapp.ipfr
left join keenek1.shield_lookupx on ipfr.emsisdn = shield_lookupx.emsisdn2
WHERE ipfr.dt = 20181105
GROUP BY dt, hh, catid, catreputation, catgrpid, serverport, urlsetmatched, urlsetprivate, responderaction, shield_status
PARTITIONED BY (dt, string)
Ошибка:
nmismatched input 'PARTITIONED' expecting <EOF>(line 18, pos 0)\n\n== SQL ==\n\nCREATE TABLE keenek1.ipfr_cf2\nAS\nSELECT\nCASE \nWHEN catreputation = 1 THEN 'Clean Site'\nWHEN catreputation = 2 THEN 'Unknown Site'\nWHEN catreputation = 3 THEN 'Potentially Dangerous or Affiliated to a dangerous site'\nWHEN catreputation = 4 THEN 'Malicious Site'\nELSE 'other'\nEND as urlcatrating,\ndt, hh, count(distinct(emsisdn)) as emsisdncount, sum(bytesdl) as download, sum(bytesul) as upload, count(*) as transactions,\ncatid, catreputation, catgrpid, serverport, urlsetmatched, urlsetprivate, responderaction, shield_status\nFROM udsapp.ipfr\nleft join keenek1.shield_lookupx on ipfr.emsisdn = shield_lookupx.emsisdn2\nWHERE ipfr.dt = 20181105\nGROUP BY dt, hh, catid, catreputation, catgrpid, serverport, urlsetmatched, urlsetprivate, responderaction, shield_status\nPARTITIONED BY (dt)\n^^^\n
"