Commit 322a5675 authored by Leo Gordon's avatar Leo Gordon
Browse files

schema change: allow recording of log_messages with worker_id=NULL

parent dd8ba28f
-- Relax the restriction that each log_message entry has to have a non-NULL worker_id; allow a NULL there:
ALTER TABLE log_message MODIFY COLUMN worker_id INTEGER DEFAULT NULL;
-- Allow log_messages from 'SEMAPHORED' jobs:
ALTER TABLE log_message MODIFY COLUMN status ENUM('UNKNOWN','SPECIALIZATION','COMPILATION','SEMAPHORED','READY','PRE_CLEANUP','FETCH_INPUT','RUN','WRITE_OUTPUT','POST_CLEANUP','PASSED_ON') DEFAULT 'UNKNOWN';
-- LEFT JOIN with worker so that entries with worker_id=NULL would still be shown:
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=50 WHERE meta_key='hive_sql_schema_version' AND meta_value='49';
......@@ -37,7 +37,7 @@ CREATE OR REPLACE VIEW progress AS
CREATE OR REPLACE VIEW msg AS
SELECT a.analysis_id, a.logic_name, m.*
FROM log_message m
JOIN worker w USING (worker_id)
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);
......
......@@ -37,7 +37,7 @@ CREATE OR REPLACE VIEW progress AS
CREATE OR REPLACE VIEW msg AS
SELECT a.analysis_id, a.logic_name, m.*
FROM log_message m
JOIN worker w USING (worker_id)
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);
......@@ -37,7 +37,7 @@ CREATE VIEW IF NOT EXISTS progress AS
CREATE VIEW IF NOT EXISTS msg AS
SELECT a.analysis_id, a.logic_name, m.*
FROM log_message m
JOIN worker w USING (worker_id)
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);
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