Shivkumar kondi
Shivkumar kondi

Reputation: 6762

Issue in Creating or Updating the Schema in BigQuery

I am trying to create/update Schema in BigQuery by passing the below JSON file to bq as

update and Create statements as :

bq mk --table [PROJECT_ID]:[DATASET].[TABLE] [PATH_TO_SCHEMA_FILE]
bq update [PROJECT_ID]:[DATASET].[TABLE] [PATH_TO_SCHEMA_FILE]

SCHEMA_FILE:

[
      {
        "mode": "REQUIRED", 
        "name": "cma_id", 
        "type": "STRING"
      }, 
      {
        "mode": "NULLABLE", 
        "name": "address_id", 
        "type": "INTEGER"
      }
]

Both the above statements are giving error as BigQuery error in mk operation: Invalid value for: REQUIRED is not a valid value

Can someone guide me what Am I Missing in Schema file?

Upvotes: 0

Views: 3382

Answers (1)

Xiaoxia Lin
Xiaoxia Lin

Reputation: 746

Just not to leave the question unanswered, the issue was an extra space as "mode": "REQUIRED " at one column (see Shivkumar's comment).

Upvotes: 3

Related Questions