Manage File Uploads
Composer can visualize data from file uploads including CSV, JSON, and TSV files.
The maximum supported file size is 500 MB
Data from the file upload is stored in a PostgreSQL database
-
When you upload a flat data file, the first 1,000 records are used to determine if fields are imported as NUMBER or INTEGER.
If there are no decimal number records in the first 1,000 records, the numeric fields are imported as INTEGER instead of NUMBER: any decimal number records after row 1,000 may not upload fully.
To ensure all records are imported, sort your data to ensure decimal numbers are included in the first 1,000 records.
Before you can establish a connection from Composer to your file uploads storage, a connector server needs to be installed and configured. See Manage Connectors and Connector Servers for general instructions.
After the connector has been set up, create a data source configuration and upload your file or files to that source. See:
Upload a New File
Log in as a user with the Administer Sources or Create New Data Sources privilege.
-
Select Add to add a new data entity, then select From File.
-
Add a unique Data Entity Name, then select Upload New File. The File Upload work area opens.
Enter File Details, such as a unique Display Name, and optional Description.
Use the Browse button to select a file to upload.
After you have selected a file, Composer may autofill the Single Quote Char. and Field Delimiter fields. Adjust if needed.
If needed, change the No. of records to display from 10 to up to 1,000 records.
Enable or disable the checkbox Column Headers in first row to match your file layout. If no column headers are in your data, Composer assigns numerical column headings, field_1, field_2, and so on.
Optionally, select Preview to preview your data.
Enable the checkbox Use Only File Structure to create the file using only the existing file structure, no data.
Enable the checkbox Disable Integer to Time Auto Detection to prevent auto detection of time fields.
Select Save to close the File Upload work area and continue creating or updating your data entity for this source.
Edit an Existing File
Log in as a user with the Administer Sources or Create New Data Sources privilege.
-
Edit an existing data source.
Select the data entity with the file you want to edit, then select Edit File. The File Upload work area opens.
-
Browse for a new file.
If you are replacing the existing file, your new file must use the same data file structure as the existing file. Enable the Replace checkbox in Upload Settings: previous data is replaced.
If you are adding data to the existing file, your new file must use the same data file structure as the existing file. Disable the Replace checkbox in Upload Settings: previous data is appended with new rows of data.
-
Select Preview to preview your data.
The Current Data tab shows the data of your existing file.
The New Data shows the replaced or amended data preview.
Select Save to Save your changes or Cancel to discard your changes. The File Upload work area closes.
API Endpoints
Log in as a user with the Administer Sources or Create New Data Sources privilege.
-
-
Select the data entity with the file you want to edit, then select API Endpoints. The API Endpoints dialog box opens.
The dialog offers convenient example cURL requests but the APIs can be leveraged from your preferred development platform.
-
Copy and modify the example cURL requests to include your own Composer credentials, replacing the placeholders for username and password. Select Close to close the dialog.
Work with the Upload API
There are two operations that can be performed using the Upload API: appending additional data and clearing previously uploaded data. The source creation page offers convenient example cURL requests but the APIs can be leveraged from your preferred development platform. Select API Endpoints on the source creation tab to edit your data.
Modify the example cURL requests to include your own Composer credentials, replacing the placeholders for username and password.
curl -v --user <username>:<password> <YourServer>
Example: Append Data
In the following example, the Upload API accepts an array of JSON objects. Note that the object field types must match those used to create the Upload API source originally. For example, if the value of the price field is a number, you can not upload new rows in which the value of the price field is a string.
Example: Clear Previously Uploaded Data
In the example below, the Upload API will clear all previously uploaded data from the data source with the ID of <YourDataSourceId>
.
curl -v --user <username>:<password> 'https://<Your_Composer_Server>/ api/upload/<YourDataSourceId>' -X DELETE --insecure
Feature Support
File upload support for specific features is shown in the following table.
Key: Y - Supported; N - Not Supported; N/A - not applicable
Feature | Supported? |
---|---|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
N/A |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
N |
|
Y |
|
Y |
|
N/A |
|
N/A |
|
N |
|
Y |
|
Y |
|
N/A |
|
Y |
|
N |
|
Y |
|
Y |
|
Y |
Comments
0 comments
Please sign in to leave a comment.