Skip to content

Instantly share code, notes, and snippets.

@rberenguel

rberenguel/data-pipelines-alloy-1.als Secret

Last active May 15, 2021
Embed
What would you like to do?
one sig Pipeline {
process: Process,
dump: Dump,
load: Load,
}
sig Engine, FileFormat {}
sig Location {}
one sig Process {
engine: one Engine,
output: one Location,
}
sig Name, Type {}
sig Column {
name: one Name,
type: one Type,
}
sig Schema {
def: set Column,
}
one sig Dump {
input: one Location,
outputFormat: one FileFormat,
output: one Location,
outputSchema: one Schema,
}
one sig Load {
schema: one Schema,
input: one Location,
inputFormat: one FileFormat,
}
pred ConsistentProcessDump[p: Pipeline]{
p.process.output = p.dump.input
}
pred ConsistentDump[p: Pipeline]{
p.dump.input != p.dump.output
}
pred ConsistentDumpLoad[p: Pipeline]{
p.dump.output = p.load.input
p.dump.outputFormat = p.load.inputFormat
}
pred ConsistentSchemas[p: Pipeline]{
p.dump.outputSchema.def = p.load.schema.def
}
fact InterestingSchemasOnly {
all s: Schema | # s.def > 1
}
run {
all p: Pipeline {
ConsistentProcessDump[p]
ConsistentDumpLoad[p]
ConsistentDump[p]
ConsistentSchemas[p]
}
} for 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment