Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
d14eca7d
Commit
d14eca7d
authored
Jul 02, 2013
by
Leo Gordon
Browse files
start showing resource_class in "progress" view + some SQL unification
parent
73df0630
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
29 deletions
+35
-29
sql/procedures.mysql
sql/procedures.mysql
+28
-25
sql/procedures.sqlite
sql/procedures.sqlite
+7
-4
No files found.
sql/procedures.mysql
View file @
d14eca7d
#########################################################################################################
#
#
Some stored functions, views and procedures used in hive:
#
-- ------------------------------------------------------------------------
--
--
Some stored functions, views and procedures used in hive:
--
####
show hive progress for analyses (turned into a view to give extra flexibility)
#####################
#
#
Thanks to Greg Jordan for the idea and the original version
#
#
Usage:
#
select * from progress; # the whole table (may take ages to generate, depending on the size of your pipeline)
#
select * from progress where logic_name like 'family_blast%'; # only show family_blast-related analyses
#
select * from progress where retry_count>1; # only show jobs that have been tried more than once
--
show hive progress for analyses (turned into a view to give extra flexibility)
----------------
--
--
Thanks to Greg Jordan for the idea and the original version
--
--
Usage:
--
select * from progress; # the whole table (may take ages to generate, depending on the size of your pipeline)
--
select * from progress where logic_name like 'family_blast%'; # only show family_blast-related analyses
--
select * from progress where retry_count>1; # only show jobs that have been tried more than once
CREATE OR REPLACE VIEW progress AS
SELECT CONCAT(a.logic_name,'(',a.analysis_id,')') analysis_name_and_id,
j.status,
j.retry_count,
CASE WHEN j.status IS NULL THEN 0 ELSE count(*) END cnt,
job_id example_job_id
FROM analysis_base a LEFT JOIN job j USING (analysis_id)
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;
####
a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name
###########
#
#
Usage:
#
select * from msg;
#
select * from msg where analysis_id=18;
#
select * from msg where logic_name like 'family_blast%';
--
a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name
------------
--
--
Usage:
--
select * from msg;
--
select * from msg where analysis_id=18;
--
select * from msg where logic_name like 'family_blast%';
CREATE OR REPLACE VIEW msg AS
SELECT a.analysis_id, a.logic_name, m.*
...
...
@@ -105,7 +108,7 @@ CREATE PROCEDURE drop_hive_tables()
MODIFIES SQL DATA
BEGIN
DROP VIEW IF EXISTS msg, progress;
DROP TABLE IF EXISTS monitor, analysis_stats_monitor, resource_description, analysis_data, job_file, dataflow_rule, analysis_ctrl_rule, analysis_stats, log_message, accu, job, worker, analysis_base, resource_class;
DROP TABLE IF EXISTS monitor, analysis_stats_monitor, resource_description, analysis_data, job_file, dataflow_rule, analysis_ctrl_rule, analysis_stats, log_message, accu, job, worker, analysis_base, resource_class
, hive_meta
;
END; //
DELIMITER ;
sql/procedures.sqlite
View file @
d14eca7d
-- ------------------------------------------------------------------------
------------------------------
-- ------------------------------------------------------------------------
--
-- Some stored functions, views and procedures used in hive:
--
-- -
-- show hive progress for analyses (turned into a view to give extra flexibility) ----------------
---
-- show hive progress for analyses (turned into a view to give extra flexibility) ----------------
--
-- Thanks to Greg Jordan for the idea and the original version
--
...
...
@@ -15,11 +15,14 @@
CREATE VIEW IF NOT EXISTS 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,
job_id example_job_id
FROM analysis_base a LEFT JOIN job j USING (analysis_id)
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;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment