Skip to content

Error on saving table to BigQuery - type mismatch #38

Open
@dimitri-b

Description

@dimitri-b

Given this schema in a source table in BigQuery:
2021-08-28_11-45-23

attempting to persist a table as a subset of the source table throws an error:

connect("bigquery:///gcp-project-id-here")

calendar = import_table("eCom_US.calendar")
temp = calendar{
    Calendar_Date,  // DATE
    Fin_Year,       // INTEGER
    Fin_Year_Label  // STRING
}[..5]
print(temp)

print(columns(temp))
// {Calendar_Date: string?, Fin_Year: int?, Fin_Year_Label: string?}

table test_data.temp_cal = temp
// Got error: 400 Query column 1 has type DATE which cannot be inserted into column Calendar_Date, which has type STRING

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions