transform

package
v0.0.0-...-8415a00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package transform includes these cast functions to allow the project to accomplish two things:

  • convert strings from the CSV files to other formats (e.g. int, float32, time.Time);
  • differentiate empty values (such as 0 for int) from missing values.

This is achieved using pointers, so we have nil as a marker for missing value.

Since our use case involves serving this data in JSON format, this is crucial so we can use `null` when there is no value, and "0" when the value of an integer, for example, is 0.

Index

Constants

View Source
const BatchSize = 8192

BatchSize determines the size of the batches used to create the initial JSON data in the database.

View Source
const MaxParallelDBQueries = 8

MaxParallelDBQueries is the default for maximum number of parallels save queries sent to the database

View Source
const NationalTreasureFileName = "TABMUN.CSV"

NationalTreasureFileName is the name of the CSV containing city names and their codes.

Variables

This section is empty.

Functions

func Transform

func Transform(dir string, db database, maxParallelDBQueries, batchSize int, privacy, mem bool) error

Transform the downloaded files for company venues creating a database record per CNPJ

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL