Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-13496: Prototype Butler Registry schema definition in YAML #13

Merged
merged 1 commit into from Feb 15, 2018

Conversation

pschella
Copy link
Collaborator

@pschella pschella commented Feb 5, 2018

No description provided.

name: Visit
dependencies:
- Camera
- PhysicalFilter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need some way of distinguishing between these relationships in this structure:

  • camera is part of Visit's primary key, and needs to be provided along with the visit number field to uniquely identify a Visit.
  • physical_filter is not a part of Visit's primary key, and is not necessary to uniquely identify a Visit.

doc: >
An inclusive range of Exposures that may be open in either direction. There
is no SQL representation; its fields (duplicated below) are all part of its
compound primary key and are hence just present in Dataset.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a machine-readable way to represent the fact that the columns here are just fields that must be present Dataset, not something that requires an new Table to be created.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought on that was that if all columns are values then no table is needed and all that exist are those columns in the Datasets table (e.g. the respective DataUnit table is skipped). Otherwise a separate table is created for this DataUnit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "values", you mean "appears in the Dataset table"? I don't see those indicated some other way (though I think the condition you want might actually be "if all columns are primary keys").

In any case, even that condition isn't enough, because it can't distinguish between "have a definition-only table" and "no table".

Link to the Quantum table (only present for SuperTask-generated Datasets).
# DataUnit values
- !Column
<<: *camera
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these going to inherit the primary_key attributes these column definitions have in the DataUnits section?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, unless overridden in the same way as nullable is.

name: parent_dataset_id
type: int
primary_key: true
nullable: false
Copy link
Member

@TallJimbo TallJimbo Feb 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SQL, primary_key=True always implies nullable=False. Should we take advantage of that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, although I'd want to check the standard on that to be sure (e.g. the actual primary key in sqllite is some auto-generated thing that you don't see so perhaps it does allow it to be nullable? Not sure.

@pschella pschella force-pushed the tickets/DM-13496 branch 3 times, most recently from 3562207 to 97e7517 Compare February 13, 2018 15:24
-
name: physical_filter
type: string
foreign_key: PhysicalFilter.physical_filter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have one link (physical_filter) or two (physical_filter and camera)? I think you have all of the necessary information here, but just to confirm it's structured:

  • No two DataUnits may have the same link.
  • A single DataUnits may (rarely) have more than one link (e.g. ExposureRange).
  • A DataUnit is fully specified by its link and the links of all required dependencies. If the DataUnit has a table, "fully specified" means those columns correspond to its (compound) primary key.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct. I am assuming that when a link is inserted the dependencies are first expanded and also included. Thus dupplicate links are not allowed.

Exposure:
dependencies:
required:
- Camera
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also:

optional:
- Visit

right?

(Just making sure this an accidental omission, not something about the structure I don't understand.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was an accidental omission (there may be more).

@pschella pschella merged commit a479a0b into master Feb 15, 2018
@timj timj deleted the tickets/DM-13496 branch April 22, 2020 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants