Skip to main content

 

ThoughtSpot

ThoughtSpot Loader Flag Reference

Overview

Explains what the feature is or what its benefits are to the user or customer.

Feature

For recurring data loads and for scripting loads, use the ThoughtSpot Loader (tsload). This reference section lists all the flags that can be used to modify the behavior of tsload.

General tsload Flags

Table 1. General tsload flags
Flag Description Notes
--target_database <database> Specifies the pre-existing target database into which tsload should load the data.  
--target_schema <schema> Specifies the target schema. Default is "falcon_default_schema".
--target_table <table> Specifies the tables that you want to load into the database. The tables must exist in the database specified by --target_database.
--empty_target Specifies that any data in the target table is to be removed before the new data is loaded. If supplied, any rows that exist in the table specified by --target_database and --target table will be deleted before this data load. To perform an "upsert" on the existing data, omit this flag or specify --noempty_target.
--max_ignored_rows <number> Specifies the maximum number of rows that can be ignored if they fail to load. If the number of ignored rows exceeds this limit, the load will be aborted.
--bad_records_file <path_to_file>/<file_name> Specifies the file to use for storing rows that failed to load. Input rows that do not conform to the defined schema in ThoughtSpot will be ignored and inserted into this file.
--date_format <date_formatmask> Specifies the format string for date values. The default format is yearmonthday e.g. "Dec 30th, 2001" and is represented as 20011230. Use the date format specifications supported in the strptime library function.
--date_time_format <date_formatmask> <time_formatmask> Specifies the format string for datetime values. The default is yearmonthday hour:minute:second e.g. Dec 30th, 2001 1:15:12 and is represented as 20011230 01:15:12. Use the datetime format specifications supported in the strptime library function.
--time_format <time_formatmask> Specifies the format string for time values. The default is hour:minute:second. Use the time format specifications supported in the strptime library function.
--v=[0|1|2|3|4|5|6] Specifies the verbosity of log messages. Provide a values from 0 to 6, to designate the verbosity level. By default, verbosity is set to the minimum, which is 0.

File Loading tsload Flags

The following flags are used when loading data from an input file:

Table 2. File loading tsload flags
Flag Description Notes
--source_file <path_to_file>/<file_name> Specifies the location of the file to be loaded.  
--source_data_format [csv|delimited] Specifies the data file format. Optional. The default is csv.
--field_separator "<delimiter>"

Specifies the field delimiter used in the input file.

 
-- trailing_field_separator Specifies that the field separator appears after every field, including the last field per row. Example row with trailing field separator: a,b,c,

The default is false.

--null_value "<null_representation>" Specifies how null values are represented in the input file. These values will be converted to NULL upon loading.
--date_converted_to_epoch [true|false] Specifies whether the “date” or “datetime” values in the input file are represented as epoch values.  
--boolean_representation [true_false | 1_0 | T_F | Y_N] Specifies the format in which boolean values are represented in the input file. The default is T_F. You can also use this flag to specify other values. For example, if your data used Y for true and NULL for false, you could specify:
--boolean_representation Y_NULL
--has_header_row Indicates that the input file contains a header row. If supplied, the first row of the file is ignored. If not supplied, the first row of the file is loaded as data.
--escape_character "<character>" Specifies the escape character used in the input file. If no value is specified, the default is "(double quotes).
--enclosing_character "<character>"

Specifies the enclosing character used in the input file.

If the enclosing character is double quotes, you need to escape it, as in this example: --enclosing_character "\""
--use_bit_boolean_values = [true | false] Specifies how boolean values are represented in the input file.

If supplied, the input CSV file uses a bit for boolean values, i.e. the false value is represented as 0x0 and true as 0x1. If omitted or set to false, boolean values are assumed to be T_F, unless you specify something else using the flag --boolean_representation [true_false | 1_0 | T_F | Y_N].

  • Was this article helpful?