Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

feat: Provide option to have multiple null markers #830

Closed

Description

@dshinzie

Currently, load jobs only take in a single string value in the null_marker param. It would be great if this could take in an array of strings, as there could be multiple string representations that should loaded in as null e.g.

LoadJobConfig(
    schema=schema,
    skip_leading_rows=1,
    source_format=SourceFormat.CSV,
    write_disposition=WriteDisposition.WRITE_TRUNCATE,
    null_marker=['NA', '', '#NA', 'na']
)

An alternative that many have proposed is loading all your data into one table, and having some process that "cleans" your data and properly loads the correct values into a 2nd, final table. Obviously this will work but takes some time, and having multiple null markers seems like a simple solution that can solve problems with loading CSVs into BigQuery with specific schemas (e.g. having a numeric data type field).

Activity

  1. added
    api: bigquery
    on Jul 28, 2021
  2. added
    type: feature request
    on Jul 29, 2021
  3. plamut commented on Jul 29, 2021

    @plamut
    Contributor

    This sounds reasonable, although it might first require a change on the backend. The API docs for this field indicate that currently only a single value is supported.

    @tswast Do you have an idea how much work would it require to support this on the backend? If/when that is implemented, adding client support for this would be trivial.

  4. tswast commented on Jul 29, 2021

    @tswast
    Contributor

    Thanks for the request! Yes, this would definitely require backend changes, as that's where the CSV parsing actually happens. I recommend filing an issue here: https://issuetracker.google.com/issues/new?component=187149&template=1162659

    An alternative that many have proposed is loading all your data into one table, and having some process that "cleans" your data and properly loads the correct values into a 2nd, final table.

    Yes, that's the general advice. Basically, load everything as STRING and then transform with SQL. Not ideal, but does give you flexibility.

    Do you have an idea how much work would it require to support this on the backend? If/when that is implemented, adding client support for this would be trivial.

    Per a Googler on the BigQuery leadership team in https://issuetracker.google.com/issues/35906027#comment20 "We do not have plans to extend the way we ingest CSV data at the moment.", so I wouldn't get your hopes up too much.

  5. added
    external
    status: blocked
    on Jul 29, 2021
  6. tswast commented on Aug 6, 2021

    @tswast
    Contributor

    I've filed https://issuetracker.google.com/195760773 so that this feature request is tracked on the backend team tracker.

  7. tswast commented on Aug 6, 2021

    @tswast
    Contributor

    Closing this issue here since it's 100% dependent on the backend adding this feature. If they do launch the feature, we'll track the client changes then.

  8. self-assigned this
    on Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigqueryexternalstatus: blockedtype: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions