Data Operation - Create
About
create is an intermediate operation that creates the metadata (ie structure, …) from its inputs (ie data resource)
- This operation does not create any data. It creates only the metadata.
Create vs SQL DDL Create
This operation is not DDL CREATE statement.
This operation can:
- create by metadata copy of its inputs
- and optionally create a view from a select input
If you want to use the SQL DDL CREATE statement, you need to create and execute a SQL DDL Query
Howto
The data create command gives you access to the create operation to create resources.
Howto that are using the tabul create command:
Usage
Creation By Selection
When you use the select operation as supplier (ie when you select your resources), the create operation will apply the following create actions:
| Create Action | target-data-uri argument | target-media-type argument | Inputs Expected |
|---|---|---|---|
| Creation by metadata copy | Mandatory | Optional | All data resources expect runtime resources |
| Create view as | Mandatory | sql view | sql select query |
Creation By Definition
When you use the define operation as supplier (ie when you define your data resources), the create operation will apply the following create actions:
| Action | target-data-uri |
|---|---|
| In-place creation | Null |
| Out-of-place creation (by metadata copy) | Not null |
Arguments
| Name | Default | Description |
|---|---|---|
| target-data-uri | See usage | A template data uri that defines where the data resources should be created. |
| target-media-type | Optional | The target media type that defines the data type of resource created. Derived from the target-data-uri if empty |
| target-data-def | Optional | Metadata applied to the created resources (ie target) specified in a data definition format |
| processing-type | batch | The processing type |
| output | results | The outputs type. One of: results, inputs, targets |
Results Output Type
The results output type is a tabular resource with 2 columns:
- the input
- the target
Cli
The data create command gives you access to the create operation to create resources.
Note
How to copy data resource with foreign keys?
In Batch processing, the create operation will also copy the foreign keys of data resource in the batch.
If you want to create a star schema, you can specify in the select operation to take the foreign table with the -with-dependencies option. Example: Tabul - How to copy the data definition of all tables from a star/snowflake schema
Empty but Size not null
The created resources are empty but may have a size not null.
Why? Some resource stores their metadata close to their data.
For instance, a csv has headers that will count toward the size.
Other operations that creates data resources
- By default, any transfer operations will create the target data resource from its input if it does not exist
- The template operation will also create data resources.