Skip to content

Audit Tables (aud_*)

The aud_* tables are the configuration backbone of the platform. They live in BigQuery and define every aspect of pipeline behavior at runtime.


Table Hierarchy


Table Reference

aud_modelo

Top-level grouping. Represents a business domain or data model.

ColumnTypeDescription
modelo_idSTRINGUnique identifier, used as DAG lookup key
nombreSTRINGHuman-readable name
descripcionSTRINGBusiness context
chain_dagSTRINGWhich chain DAG owns this model
is_activeBOOLWhether this model is processed
owner_teamSTRINGResponsible team
owner_emailSTRINGContact for alerts

aud_entidad

One row per table/entity extracted from a source.

ColumnTypeDescription
entidad_idSTRINGUnique identifier
modelo_idSTRINGFK to aud_modelo
nombreSTRINGEntity name (maps to table/file name)
source_typeSTRINGoracle / api_rest / csv / pdf
extraction_modeSTRINGfull / incremental
executor_typeSTRINGairflow / dataflow
dataflow_templateSTRINGTemplate name if executor = dataflow
gcs_destinationSTRINGGCS bucket/path for raw Avro
bq_dataset_historySTRINGBQ dataset for history table
bq_dataset_activeSTRINGBQ dataset for active table
is_activeBOOLWhether this entity is processed

Valid values:

yaml
source_type: [oracle, api_rest, csv, pdf]
extraction_mode: [full, incremental]
executor_type: [airflow, dataflow]

aud_columna

Schema definition per entity. Drives MERGE keys and validations.

ColumnTypeDescription
columna_idSTRINGUnique identifier
entidad_idSTRINGFK to aud_entidad
nombre_columnaSTRINGColumn name in source and BQ
tipo_datoSTRINGBQ data type
es_pkBOOLUsed as MERGE key in active layer
es_partitionBOOLPartition column (fecha_lote)
es_requeridaBOOLNOT NULL validation

aud_dependencia

Defines execution dependencies between entities.

ColumnTypeDescription
dependencia_idSTRINGUnique identifier
entidad_idSTRINGEntity that depends on another
entidad_dependiente_idSTRINGEntity that must complete first
tipo_dependenciaSTRINGdata / execution
descripcionSTRINGReason for dependency

aud_calendario

Controls scheduling and chain placement.

ColumnTypeDescription
calendario_idSTRINGUnique identifier
entidad_idSTRINGFK to aud_entidad
schedule_cronSTRINGCron expression
grupo_dagSTRINGWhich Group DAG this entity belongs to
chain_dagSTRINGWhich Chain DAG owns this group
orden_en_cadenaINTSequential order within the chain
excluir_feriadosBOOLSkip execution on holidays
timezoneSTRINGe.g. America/Argentina/Buenos_Aires

aud_validacion

Validation rules evaluated pre and post extraction.

ColumnTypeDescription
validacion_idSTRINGUnique identifier
entidad_idSTRINGFK to aud_entidad
tipo_validacionSTRINGrow_count / schema / not_null / business_rule
momentoSTRINGpre_extraction / post_extraction / post_load
expresionSTRINGSQL expression or threshold
severidadSTRINGwarning / error (error halts pipeline)
mensaje_errorSTRINGHuman-readable error description
is_activeBOOLWhether this rule is evaluated

How the Framework Reads These Tables

At DAG startup, the framework executes a single parameterized query:

sql
SELECT
    e.*,
    ARRAY_AGG(c) AS columnas,
    ARRAY_AGG(v) AS validaciones,
    cal.grupo_dag,
    cal.orden_en_cadena
FROM aud_entidad e
JOIN aud_modelo m ON e.modelo_id = m.modelo_id
JOIN aud_calendario cal ON e.entidad_id = cal.entidad_id
LEFT JOIN aud_columna c ON e.entidad_id = c.entidad_id
LEFT JOIN aud_validacion v ON e.entidad_id = v.entidad_id AND v.is_active = TRUE
WHERE cal.grupo_dag = @dag_name
  AND e.is_active = TRUE
  AND m.is_active = TRUE
GROUP BY e.entidad_id, ..., cal.grupo_dag, cal.orden_en_cadena

The result is a fully resolved config object per entity, ready for task generation.