As explained in the documentation for loading JSON data stored in GCS to BigQuery, the JSON data must be in Newline Delimited JSON format, in which each line is a valid independent JSON value, therefore instead of (1), you should use (2)):
(1)
[
{ "item_name": "dfkhjf", "gtin": "123456", "brand": "Om-Publication","category_name": "books", "country_code": "IN", "marktet_place": "india", "price": 2239, "sellerId": 234, "create_time": "2017-07-19T16:00:46.000Z" },
{ "item_name": "toy-gun", "gtin": "1234234445", "brand": "Toy", "category_name": "toy", "country_code": "IN", "marktet_place": "flipMe", "price": 2239, "sellerId": 234, "create_time": "2017-08-19T16:00:46.000Z" },
{ "item_name": "Drone", "gtin": "12342356456", "brand": "Drone-XX", "category_name": "drone", "country_code": "IN", "marktet_place": "drone-maker", "price": 2239, "sellerId": 234, "create_time": "2017-09-19T16:00:46.000Z" }
]
(2)
{ "item_name": "dfkhjf", "gtin": "123456", "brand": "Om-Publication","category_name": "books", "country_code": "IN", "marktet_place": "india", "price": 2239, "sellerId": 234, "create_time": "2017-07-19T16:00:46.000Z" }
{ "item_name": "toy-gun", "gtin": "1234234445", "brand": "Toy", "category_name": "toy", "country_code": "IN", "marktet_place": "flipMe", "price": 2239, "sellerId": 234, "create_time": "2017-08-19T16:00:46.000Z" }
{ "item_name": "Drone", "gtin": "12342356456", "brand": "Drone-XX", "category_name": "drone", "country_code": "IN", "marktet_place": "drone-maker", "price": 2239, "sellerId": 234, "create_time": "2017-09-19T16:00:46.000Z" }
UPDATE:
Here a step-by-step guide in order to show how this works:
Create a JSON file (file.json in my case) with the content I shared (make sure to remove the array brackets [] and also the commas , at the end of each line:
$ cat file.json
{ "item_name": "dfkhjf", "gtin": "123456", "brand": "Om-Publication","category_name": "books", "country_code": "IN", "marktet_place": "india", "price": 2239, "sellerId": 234, "create_time": "2017-07-19T16:00:46.000Z" }
{ "item_name": "toy-gun", "gtin": "1234234445", "brand": "Toy", "category_name": "toy", "country_code": "IN", "marktet_place": "flipMe", "price": 2239, "sellerId": 234, "create_time": "2017-08-19T16:00:46.000Z" }
{ "item_name": "Drone", "gtin": "12342356456", "brand": "Drone-XX", "category_name": "drone", "country_code": "IN", "marktet_place": "drone-maker", "price": 2239, "sellerId": 234, "create_time": "2017-09-19T16:00:46.000Z" }
Load the file to BQ, running a command like below:
$ bq load --autodetect --source_format=NEWLINE_DELIMITED_JSON dataset.table file.json
Upload complete.
Waiting on bqjob_XXXXXXXXXXX ... (1s) Current status: DONE
Now query the table in order to check that the content was uploaded correctly:
$ bq query --use_legacy_sql=false "SELECT * FROM dataset.table"
Waiting on bqjob_r3ef14ac0d0a6c856_000001681819e9fc_1 ... (0s) Current status: DONE
+----------+-------+---------------------+---------------+----------------+--------------+---------------+-------------+-----------+
| sellerId | price | create_time | marktet_place | brand | country_code | category_name | gtin | item_name |
+----------+-------+---------------------+---------------+----------------+--------------+---------------+-------------+-----------+
| 234 | 2239 | 2017-07-19 16:00:46 | india | Om-Publication | IN | books | 123456 | dfkhjf |
| 234 | 2239 | 2017-08-19 16:00:46 | flipMe | Toy | IN | toy | 1234234445 | toy-gun |
| 234 | 2239 | 2017-09-19 16:00:46 | drone-maker | Drone-XX | IN | drone | 12342356456 | Drone |
+----------+-------+---------------------+---------------+----------------+--------------+---------------+-------------+-----------+