Sara Boctor
Sara Boctor

Reputation: 41

Is the column of type JSON deprecated?

In the bigquery console, when creating a table, there used to be type JSON as an option for the column types but weirdly enought it was never present in their docs We used this column type in our production tables, and discovered later on that you can't select it in queries otherwise bigquery throws an error, and the json functions also didn't work with it. So we simply stopped using this column in the queries but they still exist in our tables.

However, in the past couple of days, all queries against this table are failing with this error 400 Json is not enabled for current project. and this column type is not present in the bigquery console anymore. It seems it was removed or deprecated? I checked the release notes, but the latest release was way before the error occured. This broke our production environment, and we couldnt even export the data because exporting gave the same error. Instead we had to use a new table without this column which meant we lost all our history.

Did anyone face the same problem with any other column types before, is it normal that a type is deprecated without users being notified beforehand. This is making me question the reliability of bigquery.

Upvotes: 4

Views: 3728

Answers (3)

Yaron Cohen
Yaron Cohen

Reputation: 21

I ran into the same error message few days ago and was surprised to read about this policy change that's not backed up by a mitigation process. My attempt to use Vlad Grachev suggestion to drop this column did not prevail, as the console does not allow to query this table (same "Json is not enabled for current project." error). My only remediation at this point is:

  • build a new table where the json column is switched to type string
  • create a pipeline that transforms the objects to strings
  • migrate the data through the pipeline to the new table

Upvotes: 2

Vlad Grachev
Vlad Grachev

Reputation: 146

Please reach out to Google Cloud support and we will help you fix your issue with that problematic table. You may also want to try fixing it yourself using the ALTER TABLE DROP COLUMN statement that is currently in public preview [1]. This will drop the erroneous column (the data in that column only will be lost). The rest of the data will remain usable.

[1] https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_table_drop_column_statement

Upvotes: 2

Nimal V
Nimal V

Reputation: 176

In BigQuery Json data can be stored in a column type "Record.Are you referring the same by JSON column type? BigQuery uses the RECORD (or STRUCT) type to represent nested structure. A column of RECORD type is in fact a large column containing multiple child columns. For more information Refer the link below, Json Data in BigQuery

if you are not refering to the Record Data type, The Json Column type might be a test feature that might not dependent on deprecation scheme

Upvotes: 0

Related Questions