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.

Support jsonExtension in LoadJobConfig #1581

Closed

Description

@bkanuka

This would allow running the equivalent to:

bq load --source_format=NEWLINE_DELIMITED_JSON --json_extension=GEOJSON  <some>.<table>  <some_geojson_path>

Activity

  1. added
    api: bigquery
    on Jun 8, 2023
  2. changed the title [-]Support jsonExtenstion in LoadJobConfig[/-] [+]Support jsonExtension in LoadJobConfig[/+] on Jun 8, 2023
  3. added
    type: feature request
    priority: p3
    on Jun 9, 2023
  4. chalmerlowe commented on Jun 20, 2023

    @chalmerlowe
    Collaborator

    Adding some notes for myself (and anyone who wants to tackle this):

    Would need to take a look at LoadJobConfig and determine:

    • Is this the right place to make these additions?
    • What are the exact changes needed to add this feature?
    • What tests need to be added to support testing of the new feature
  5. bkanuka commented on Jun 30, 2023

    @bkanuka
    Author

    I can't answer all your questions, but this workaround accomplishes what I want:

    job_config = bigquery.LoadJobConfig(..., ..., ...)
    job_config._set_sub_prop('jsonExtension', 'GEOJSON')
    
  6. chalmerlowe commented on Jul 5, 2023

    @chalmerlowe
    Collaborator

    @bkanuka thanks for this additional context.

  7. self-assigned this
    on Dec 4, 2023
  8. kiraksi commented on Dec 13, 2023

    @kiraksi
    Contributor

    @chalmerlowe On this issue, how would you handle cases where we have two parameters passed in "sourceFormat" and "jsonExtension" with conflicting values, which should be prioritized? If sourceFormat is set to AUTODETECT, should we just fall back on the jsonExtension value? I am assuming since the jsonExtension value is more specific compared to sourceFormat, we would want to prioritize that if passed in, but not sure if that is definitely the case here. EDIT: These fields are doing seperate things and do not have overlap

  9. chalmerlowe commented on Dec 15, 2023

    @chalmerlowe
    Collaborator

    @kiraksi

    We discussed this yesterday, but gonna add this note in case someone comes along after us and reads this issue.

    These fields should be very different in focus:

    • sourceFormat is used to identify what separates individual JSON records from each other
    • jsonExtension is used to identify which type of records to expect (i.e. GEOJSON for geographical data). Specific JSON extensions may have defined datatypes that are not present in vanilla JSON.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigquerypriority: p3type: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions