Skip to content

Add --null-value flag to treat specific strings as NULL #160

Description

@vmvarela

Description

Treat a specific string (e.g., "N/A", "-", "NA") as NULL during loading.

Examples

$ cat data.csv
name,age
Alice,30
Bob,N/A
Carol,25

$ sql-pipe --null-value 'N/A' 'SELECT * FROM t WHERE age IS NOT NULL' data.csv
Alice,30
Carol,25

Acceptance Criteria

  • --null-value <string> flag treats matching values as NULL during loading
  • Works with all input formats
  • Can be specified multiple times for multiple null sentinels
  • Case-sensitive matching
  • All existing tests pass
  • New tests cover null value handling

Notes

  • Implementation: ~20 lines
  • Many real-world CSVs use sentinel values for missing data
  • Currently these load as TEXT, breaking numeric aggregation
  • High value for messy-data workflows

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:lowNice to have, do when possiblesize:xsTrivial — less than 1 hourtype:featureNew functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions