Spec tree

The spec tree is an XML file containing the metadata for uploading flat files into 1010data Insights Platform.

Spec metadata

XML Elements Description of Element Content
<spec> Outer specification element (required)

Table metadata

XML Elements Description of Element Content
<name></name> File path of table in 1010data (e.g., mycompany.mytable).

If you reference an existing table, addtab will replace it.

<ts></ts> Time-series flag.

1 for true, or 0 for false.

Requires that <bord> tags are provided in at least one column.

<title></title> Table title as it appears in the user interface
<sdesc></sdesc> Short description of the table
<ldesc></ldesc> Long description of table
<link></link> Link header
<users type="[TYPE]"></users> Specifies users provisioned for table access. User type can be "private", "inherit", or "list".

If the <users> element is excluded, only the table owner may access the table.

See Users Tree for XML schema and <users> (Top-level wrapper for users tree in the 1010data API Reference Manual for usage details.

<user></user> Specifies each user that may access the table.

Used in conjunction with the <users> element when type is list (or if type is omitted).

Each <user> element is nested inside the <users> top-level wrapper.

Column metadata

XML Elements Description of Element Content
<cols></cols> Column specifications (required)

List of <col> elements, one for each column in the file.

<col></col>s A column element (required)

There must be one of these for each column in the table.

<name></name> Field name (required)

Must begin with an alphabetical character.

<head></head> Column label

Use ` to separate lines.

<help></help> Column help (text inside ? marker above column)
<skip></skip> Specified columns are not read, written, or uploaded. Valid values are 0 or 1.
<type></type> Column data type (required). This is analogous to data types in the 1010data Insights Platform. The Data types section in this guide lists the data types accepted by TenUp.

See also the Data types and display formats section of the 1010data Reference Manual for an overview of the difference between data types and display formats in the 1010data Insights Platform.

<format></format> Column formatting. This is analogous to display formats in the 1010data Insights Platform. See Display formats in the 1010data Reference Manual for more details about display formats.

Within <format></format>, you must specify <type></type>, <width></width>, and <dec></dec> within <format></format>. For the complete list of display format types for <format><type></type></format>, see Display formats.

<width></width> Field width in the raw file

(Optional if rectype is separated.)

<case></case> Force case, either upper or lower
<nowrite></nowrite> Whether to ignore the field in the newly-created table. Valid values are 0 (do not ignore the field) or 1 (ignore the field).
<order></order> Column placement relative to other columns (integer) in the uploaded table
<fix></fix> Column is non-scrolling (pink). Valid values are 0 or 1.
<bord></bord> TS segmentation order (integer).

The number provided here is the relative segmentation order of this column in relation to other columns with the <bord> tag.

Think of <bord> columns as tabulation breaks. The column that denotes time should have the largest number in the sequence.

<index></index> Whether the column should be indexed. Valid values are 0 (do not index) or 1 (index).
<exp></exp> 1010data Insights Platform expression applied to raw data (not nested).

Data source metadata

XML Elements Description of Element Content
<source></source> Specifies the source or sources. This is required.
<file></file> Specifies the file names of the sources. This is required.
<rectype></rectype> fixed or separated. The default value is separated.
<sep></sep> Single character delimiter or by the character's name

, or comma. The default value is comma.

<eor></eor> End of record delimiter
<arch></arch> Byte order of data, which is either little or big endian
<begrecs></begrecs> Number of records to skip in the beginning of the table
<numrecs></numrecs> Number of records to load in the table
<maskw></maskw> Defines the maximum width of a variable-width text column.
<mchr></mchr> Specifies the encapsulating character of a variable width text column
<ignore_null></ignore_null> Whether to replace null values with spaces. Valid values are 0 (do not replace null characters) and 1 (replace null characters).
<stripefactor></stripefactor> The number of servers in which to write each segment of a table, thereby assuring redundancy and load balancing

Spec tree example

The following is an example of a spec tree for a flat file to be loaded.

<spec>
   <source>
    <file>mytable20060101.txt</file>
    <file>mytable20060201.txt</file>
  </source>
  <name>mycompany.mytable</name>
  <title>Mytable 2006</title>
  <sdesc>short description of the table</sdesc>
  <ldesc>long description of table</ldesc>
  <link>FOO</link>
  <users>
    <user>user1</user>
    <user>user2</user>
  </users>
  <rectype>fixed</rectype>
  <eor>crlf</eor>
  <cols>
  <col>
      <name>deal</name>
      <width>12</width>
      <head>Deal ID</head>
      <type>int</type>
      <format>
          <type>nocommas</type>
          <width>3</width>
          <dec>0</dec>
      </format>
  </col>
  <col>
    <name>date</name>
    <width>55</width>
    <head>Distribution Date</head>
    <type>YYYYMMDD</type>
    <format>
      <type>date</type>
      <width>8</width>
    </format>
  </col>
  <col>
    <name>loan</name>
    <width>21</width>
    <head>Loan`Number</head>
    <type>int</type>
    <exp>loan+2</exp>
  </col>
  </cols>
</spec>