Tables (regardless of their type - partitioned  or regular) are registered using the following service:

methodresource name
POST/ingest/table 

Where a JSON  object sent to the service with the requests will describe that table. This is a schema of the object for the partitioned  tables:

{"database":<string>,
 "table":<string>,
 "is_partitioned":<number>,
 "director_table":<string>,
 "director_key":<string>,
 "director_table2":<string>,
 "director_key2":<string>,
 "latitude_key":<string>,
 "longitude_key":<string>,
 "flag":<string>,
 "ang_sep":<double>,
 "unique_primary_key":<number>,
  "schema":[
   {"name":<string>,"type":<string>},
   ...
 ],
 "auth_key":<string>
}

A description of the regular  tables has a fewer number of attributes (attributes that were required for the partitioned  tables are missing):

{"database":<string>,
 "table":<string>,
 "is_partitioned":<number>,
 "schema":[
   {"name":<string>,"type":<string>},
   ...
 ],
 "auth_key":<string>
}

Also, note that the table schema does not include definitions of indexes. Those are managed separately after the catalog will be published. The index management interface is documented in a dedicated document Managing indexes of MySQL tables at Qserv workers.

This table explains the attributes:

attributerequireddescription
database
bothThe name of an existing database.
table
bothThe name of a new table to be registered.
is_partitioned
bothThe type of table. Allowed values: 1  for partitioned tables, 0  for the regular tables.
director_table
partitioned

The name of the corresponding first director table. The name is required to be not empty for the dependent tables, and it has to be empty for the director tables. This is the only way to differentiate between two types of partitioned tables.

director_key
partitionedThe name of a column in a partitioned table that represents the primary key of the director table if this is the director table or the foreign key of the dependent table pointing to the corresponding column of the director table.
director_table2
RefMatch (partitioned)

The name of the corresponding first director table. The name is required to be not empty for the RefMatch tables, and it has to be empty for any other tables.

(warning) The very presence of this attribute in the input configuration would imply an intent to register the RefMatch  table. In this case, non-empty values of the attributes director_key2 , flag  and ang_sep  will be required in order to succeed with the registration.

director_key2
RefMatch (partitioned)The name of a column that identifies the corresponding rows in the second matched director table. A value of this attribute must not be empty when registering the RefMatch  tables. It will be ignored for other table types.
flag
RefMatch (partitioned)

The name of the special column that is required to be present on the RefMatch tables. Values of the column are populated by the tool sph-partition-matches  when partitioning the input files of the RefMAtch tables. The data type of this column is usually:

INT UNSIGNED
ang_sep
RefMatch (partitioned)A value of the angular separation for the matched entries in the RefMatch tables. This value will be used by Qserv when using the table to process the corresponding queries.
unique_primary_key
(warning) optional for: director 

The optional (boolean) flag allows to drop the uniqueness requirement for the director keys of the table. The parameter is meant to be used for testing new table products, or for the director tables that won't have any dependants (child tables). Allowed values: 0  for false, or any other number (recommended to use 1) for true.

The default value of the parameter is 1.

latitude_key
partitionedThe name of a column in a partitioned table represents latitude. (warning) The value of the parameter is optional for the dependent tables.
longitude_key
partitionedThe name of a column in a partitioned table represents longitude. (warning) The value of the parameter is optional for the dependent tables.
schema
both

An object representing table schema.

  • The partitioned  tables are required to have parameters director_keylatitude_key and longitude_key.
  • The director  tables are required to have non-empty column names in the parameters  director_key,latitude_key and longitude_key.
  • The dependent  tables are required to have a non-empty column name specified in the parameter director_key.
  • The dependent  tables are allowed to have empty values in the parameters latitude_key and longitude_key.
  • Do not use quotes around the names or type specifications.

Where:

attributedescription
nameThe name of a column.
type

The type of column. For example: 

INT UNSIGNED NOT NULL
auth_key
bothA value of an authorization key.

In case of successful completion (see Error reporting in the REST API) the service is expected to return a JSON object with an updated description of the database:

{...
 "database":{...}
}

Where the database key in that object will report various info on the database and its tables.

Notes on the table names

And these are some notes on the naming conventions (restrictions) for the tables:




  • No labels