Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
58 views
in Technique[技术] by (71.8m points)

BigQuery invalid JSON

I am trying to import a small JSON file on BigQuery but I am getting an error during the upload: Invalid field name "5527453". Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 128 characters long. Table: popopo_5466c12e_eded_418b_b558_e6d53c8d0926_source. What can be the issue? I checked the validity on my JSON and it's a valid JSON file.

{
    "5527453": {
        "conversion_events": {
            "data": [{
                "id": "111972323",
                "name": "Website Adds of Payment Info"
            }, {
                "id": "111971323",
                "name": "Website Adds to Cart"
            }, {
                "id": "11197132",
                "name": "Website Purchases"
            }, {
                "id": "1119727",
                "name": "Forfait + Fixe 4p"
            }, {
                "id": "111972517",
                "name": "Fixe"
            }, {
                "id": "111972",
                "name": "Total Fixe"
            }, {
                "id": "111972514",
                "name": "Total Forfait"
            }, {
                "id": "11197251",
                "name": "Forfait"
            }, {
                "id": "11197251",
                "name": "Device RM"
            }, {
                "id": "111972",
                "name": "Total Device"
            }, {
                "id": "11197251",
                "name": "Device nu"
            }, {
                "id": "1119725",
                "name": "Forfait + Device"
            }]
        },
        "id": "3184292"
    }
}
question from:https://stackoverflow.com/questions/65887740/bigquery-invalid-json

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 128 characters long.

Because your JSON will be loaded into BigQuery as a table, with "5527453" being the name of the column. BigQuery doesn't allow number-only column name, this is what the error message is complaining about. Here field just mean table column.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...