Commit 0d1dd4c9 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

patchfix: the patch was not patching the views

parent 04881ae7
-- first drop the views that depend on these types
DROP VIEW progress;
DROP VIEW msg;
-- extend all VARCHAR fields to 255 (this will not affect neither storage nor performance) :
ALTER TABLE analysis_base ALTER COLUMN logic_name SET DATA TYPE VARCHAR(255);
......@@ -11,6 +16,27 @@ ALTER TABLE worker ALTER COLUMN meadow_name SET DATA TYPE VARCH
ALTER TABLE worker ALTER COLUMN host SET DATA TYPE VARCHAR(255);
ALTER TABLE worker ALTER COLUMN process_id SET DATA TYPE VARCHAR(255);
-- recreate the views
CREATE OR REPLACE VIEW progress AS
SELECT a.logic_name || '(' || a.analysis_id || ')' analysis_name_and_id,
MIN(rc.name) resource_class,
j.status,
j.retry_count,
CASE WHEN j.status IS NULL THEN 0 ELSE count(*) END cnt,
MIN(job_id) example_job_id
FROM analysis_base a
LEFT JOIN job j USING (analysis_id)
LEFT JOIN resource_class rc ON (a.resource_class_id=rc.resource_class_id)
GROUP BY a.analysis_id, j.status, j.retry_count
ORDER BY a.analysis_id, j.status;
CREATE OR REPLACE VIEW msg AS
SELECT a.analysis_id, a.logic_name, m.*
FROM log_message m
LEFT JOIN worker w USING (worker_id)
LEFT JOIN job j ON (j.job_id=m.job_id)
LEFT JOIN analysis_base a ON (a.analysis_id=j.analysis_id);
-- UPDATE hive_sql_schema_version
UPDATE hive_meta SET meta_value=53 WHERE meta_key='hive_sql_schema_version' AND meta_value='52';
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment