TenUp: Step-by-step example

The following is a step-by-step example of uploading a csv file to the 1010data Insights Platform, including creating a table tree file for uploading metadata.

Prepare the data file

You will need a clean data file to upload to the 1010data Insights Platform. The data types must match the data types supplied in the table tree metadata, with the columns in the same order. The flat file to upload is typically a csv (comma-separated values) file.

In this example, the data to upload is contained in a file named data.csv. The following is the contents of data.csv:


Provide metadata

To upload the data file to a 1010data Insights Platform table, you need to supply TenUp with metadata for your table. Metadata can be supplied in a table tree, spec tree, and/or on the TenUp command line. In this simple example, the metadata is supplied with a single source--a table tree saved in a file named Retail.xml.

The following is the contents of Retail.xml:

<table name="example.retail">
  <sdesc>Test table</sdesc>
    <th name="transid" type="i">Transaction ID</th>
    <th name="store" type="i">Store</th>
    <th name="sumsales" type="f" format="type:currency">Sum of&#10;Sales</th>
    <th name="totunits" type="f" format="type:num;width:4;dec:0">Total Units</th>

This table tree provides the following information for the 1010data Insights Platform table: the table name and title, a short description, and the names and titles of the table's four columns. The transid and store columns contain integers. The sumsales and totunits columns contain floats. Note that sumsales and totunits have a display format in addition to a data type.

For more detailed information about table tree tags, refer to Table Tree in the XML API Reference Manual.

For a detailed explanation of data types and display formats, see Data types and display formats in the 1010data Reference Manual.

Issue the TenUp command

As discussed in Loading data from a flat file, the template for loading a flat file into TenUp is as follows:
If you use the Retail.xml table tree and the data.csv flat file, you would enter a command similar to the following:
$ tenup64 -u login -p password -g https://www2.1010data.com/beta-latest/gw 
      @C:\tenupexample\Retail.xml C:\tenupexample\data.csv
Note: For the sake of completeness, the above TenUp command also contains a gateway, specified by the -g switch. If you are using the default gateway, you can omit -g and the gateway information.
Your 1010data Insights Platform user ID.
Your 1010data Insights Platform password.
Your specified gateway (can be omitted if the default gateway).
The complete path to the table tree Retail.xml, containing the table metadata. The @ specifies that the information that follows is the path to the table tree file.
The complete path to the table data to upload, saved as a csv file.

Confirm the table upload

You can log in to the 1010data Insights Platform and view the uploaded table. The table can be found in the example folder with the name retail and a title of Retail. The table will appear as follows: