Skip to content

Column type detection strategy for numbers ending with .0 #747

@larshelge

Description

@larshelge

First of all, thanks for an excellent library!

This issue relates to the table column type detection. My use-case is having TableSaw detect the column types of a CSV data file. That information is used to create a table in AWS Redshift and later ingest the CSV file into the table. I am mapping TableSaw INTEGER column type to Redshift INTEGER data type.

I came across a corner case in which TableSaw detects numbers ending with ".0", such as "1613.0" or "962.0", as integer column type. This is arguably correct, but fails in my use-case, as AWS Redshift does not accept such values as integers and fails during data load.

Would this case be worthy of a configurable read option, to control whether numbers with zero value decimals will be mapped to integer or floating point types?

ReadOptions.zeroDecimalNumberAsFloat or a more succinct name would be great.

Tablesaw version 0.37.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions