Numeric Parsers
  • 27 Jul 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Numeric Parsers

  • Dark
    Light
  • PDF

Article summary

The numeric parser type is the second-most commonly utilized parser across all Data Products, behind the categorical parser type.

It inherits attributes and data loading behaviors from the abstract column parser type.

In most cases, it is intended to load data from a single column in a source data table into a single numeric variable placed into a collection.

Attribute - merge

The merge attribute is optional. It will default to "AVG".

{
  "parser_type": "numeric",
  "column": "cccc",
  
  // If multiple values are encountered per entity
  // this attribute will tell the system how they
  // should aggregate into a single value.
  //
  // Options are "AVG", "SUM", "FIRST", "LAST"
  //
  "merge": "SUM",
  
  "collection": "collection_name",
  "variable": "variable_name",
}

Attribute - digits

The digits attribute is optional.

{
  "parser_type": "numeric",
  "column": "cccc",
  
  // This will truncate floating point numbers to a 
  // maximum number of digits after decimal point
  //
  "digits": ####, 
  
  "collection": "collection_name",
  "variable": "variable_name",
}

Attribute - coerce

The coerce attribute is optional. It will default to use 64-bit doubles.

{
  "parser_type": "numeric",
  "column": "cccc",
  
  // This will coerce the numeric variable(s) to use 32-bit floats
  // instead of 64-bit doubles, as long as the values match
  // up to this many digits after the decimal points.
  //
  "coerce": ####,
  
  "collection": "collection_name",
  "variable": "variable_name",
}

Attribute - compress

The compress attribute is optional. It will default to "dense".

{
  "parser_type": "numeric",
  "column": "cccc",

  // If you know this numeric variable is sparse with respect
  // to entities, then the data loading can be optimized
  // by pre-specifying a sparse numeric variable.
  //
  "compress": "sparse",
  
  "collection": "collection_name",
  "variable": "variable_name",
}

Was this article helpful?