matview.cwl

  1#!/usr/bin/env cwl-runner
  2### Materialized View Creator
  3#  Copyright (c) 2021. Harvard University
  4#
  5#  Developed by Research Software Engineering,
  6#  Faculty of Arts and Sciences, Research Computing (FAS RC)
  7#  Author: Michael A Bouzinier
  8#
  9#  Licensed under the Apache License, Version 2.0 (the "License");
 10#  you may not use this file except in compliance with the License.
 11#  You may obtain a copy of the License at
 12#
 13#         http://www.apache.org/licenses/LICENSE-2.0
 14#
 15#  Unless required by applicable law or agreed to in writing, software
 16#  distributed under the License is distributed on an "AS IS" BASIS,
 17#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 18#  See the License for the specific language governing permissions and
 19#  limitations under the License.
 20#
 21
 22cwlVersion: v1.2
 23class: Workflow
 24
 25requirements:
 26  SubworkflowFeatureRequirement: {}
 27  StepInputExpressionRequirement: {}
 28
 29doc: |
 30  This tool is a shortcut to create a materialized view and build
 31  all indices associated with the view
 32
 33inputs:
 34  database:
 35    type: File
 36    doc: Path to database connection file, usually database.ini
 37  connection_name:
 38    type: string
 39    doc: The name of the section in the database.ini file
 40  table:
 41    type: string
 42    doc: the name of the table to be created
 43  domain:
 44    type: string
 45    doc: the name of the domain
 46    default: medicaid
 47  incremental:
 48    type:  boolean
 49    default: false
 50  depends_on:
 51    type: File?
 52    doc: a special field used to enforce dependencies and execution order
 53
 54steps:
 55  create:
 56    run: create.cwl
 57    doc: Execute DDL
 58    in:
 59      table: table
 60      domain: domain
 61      database: database
 62      connection_name: connection_name
 63      sloppy: incremental
 64    out: [ log, errors ]
 65
 66  index:
 67    run: index.cwl
 68    doc: Build indices
 69    in:
 70      depends_on: create/log
 71      domain: domain
 72      table: table
 73      incremental: incremental
 74      database: database
 75      connection_name: connection_name
 76
 77    out: [ log, errors ]
 78
 79  vacuum:
 80    run: vacuum.cwl
 81    doc: Vacuum the view
 82    in:
 83      depends_on: index/log
 84      domain: domain
 85      table: table
 86      database: database
 87      connection_name: connection_name
 88    out: [ log, errors ]
 89
 90outputs:
 91  create_log:
 92    type: File
 93    outputSource: create/log
 94  index_log:
 95    type: File
 96    outputSource: index/log
 97  vacuum_log:
 98    type: File
 99    outputSource: vacuum/log
100
101  create_err:
102    type: File
103    outputSource: create/errors
104  index_err:
105    type: File
106    outputSource: index/errors
107  vacuum_err:
108    type: File
109    outputSource: vacuum/errors