5. Import a File¶
In order to load a file such as CSV, FBV, JSON or Parquet follow this guide step by step.
Add a BDomain
Add BDomain Settings
Add a Loader
Add BDomain specific metadata to a Loader
Add a Column Loader per source column
Create TSA table
5.1. Add a BDomain¶
Make sure the BDomain exists or add it first: Add a BDomain
Check for the existence of the BDomain ‘TESTING’ in the table REDADM.RED_BDOMAINS.
5.2. Add CFI BDomain Settings¶
Add specific BDomain setting for CFI-loads: Add BDomain Settings.
Check the settings in the table CFIADM.CFI_BDOMAIN_SETTINGS.
5.3. Add a Loader¶
Now add a loader: Add a Loader
Check the configuration for the loader ‘PERSON’ in the table CFIADM.CFI_LOADER.
5.4. Add BDomain specific metadata to a Loader¶
Each BDomain may have different settings for the loader, e.g. diffenrent file encodings, etc.: Add BDomain specific metadata to a Loader
The result is an entry in the table CFIADM.CFI_LOADER_BD for the loader ‘PERSON’ with the BDomain ‘TESTING’.
5.5. Add a Loader Definition per Source Column¶
Now add loader columns: Add a CFI Loader Column
Check the metadata in the table CFIADM.CFI_LOADER_BD_COLUMNS for each column.
5.6. Create a TSA table¶
Now that all metadata are there we can create the corresponding TSA-table: API_CFIADM.CREATE_TSA_TABLES.
Example
1EXECUTE SCRIPT API_CFIADM.CREATE_TSA_TABLES(
2 'PERSON' -- p_ldr_name
3 ,'TESTING' -- p_bdomain
4);
This creates a table from the metadata provided before and adds all technical columns (prefixed with “RED_”) as well. The table can be found as CFITSA.TEST_PERSON.
Tip
You can fill in metadata for all loaders first and then create all missing TSA-tables at once by just calling API_DBIADM.CREATE_TSA_TABLES without any arguments (i.e., provide NULL twice).
Now copy the file into the input directory and it should be loaded within the next minute.
Attention
When uploading a file add a .tra at the end of the file to prevent unfinished files from being loaded. Make sure that redsys is the owner of the file and that the complete file has been uploaded before removing the .tra ending. If the file is loaded without any errors it can be found in the archive folder, otherwise it will be moved to the error folder as explained here.