可以将CSV数据上传到bigquery

时间:2019-09-20 20:42:43

标签: google-bigquery

我一直尝试将此csv上传到Google Bigquery中,但始终出现错误。

读取数据时出错,错误消息:CSV表遇到太多错误,放弃了。行:303;错误:1.请查看errors []集合以获取更多详细信息。 读取数据时出错,错误消息:无效时区:PM;无法将字段“ DATE”(位置2)的日期时间解析为“ 09/09/2006 11:45:00 PM”,从位置71061开始


此csv文件。我收到上面的错误。

https://ibm.box.com/shared/static/svflyugsr9zbqy5bmowgswqemfpm1x7f.csv

2 个答案:

答案 0 :(得分:0)

BigQuery日期必须使用完整的ISO标准和UTC,

This is the updated JSON
grid_template = {
    type: 'grid',
    rows: [
        {
            columns: [
                {
                    identifier: 'c1',
                    hasRows: false,
                    cashBack: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    title: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    images: { leafBannerId: '', listPageBannerId: '', overlayImage: '' },
                    width: '50%',
                    height: '20%',
                    '2X': { width: '200px', height: '400px' },
                    '3X': { width: '300px', height: '600px' },
                },
                {
                    hasRows: true,
                    rows: [
                        {
                            identifier: 'c2',
                            hasColumns: false,
                            cashBack: {
                                text: '', image: '', height: '', width: '',
                                '2X': { width: '200px', height: '400px' },
                                '3X': { width: '300px', height: '600px' },
                            },
                            title: {
                                text: '', image: '', height: '', width: '',
                                '2X': { width: '200px', height: '400px' },
                                '3X': { width: '300px', height: '600px' },
                            },
                            images: { leafBannerId: '', listPageBannerId: '', overlayImage: '' },
                            width: '50%',
                            height: '10%',
                            '2X': { width: '200px', height: '400px' },
                            '3X': { width: '300px', height: '600px' },
                        },
                        {
                            hasColumns: true, columns: [
                                {
                                    identifier: 'c3',
                                    cashBack: {
                                        text: '', image: '', height: '', width: '',
                                        '2X': { width: '200px', height: '400px' },
                                        '3X': { width: '300px', height: '600px' },
                                    },
                                    title: {
                                        text: '', image: '', height: '', width: '',
                                        '2X': { width: '200px', height: '400px' },
                                        '3X': { width: '300px', height: '600px' },
                                    },
                                    images: { leafBannerId: '', listPageBannerId: '', overlayImage: '' },
                                    width: '25%',
                                    height: '10%',
                                    '2X': { width: '200px', height: '400px' },
                                    '3X': { width: '300px', height: '600px' },
                                },
                                {
                                    identifier: 'c4',
                                    cashBack: {
                                        text: '', image: '', height: '', width: '',
                                        '2X': { width: '200px', height: '400px' },
                                        '3X': { width: '300px', height: '600px' },
                                    },
                                    title: {
                                        text: '', image: '', height: '', width: '',
                                        '2X': { width: '200px', height: '400px' },
                                        '3X': { width: '300px', height: '600px' },
                                    },
                                    images: { leafBannerId: '', listPageBannerId: '', overlayImage: '' },
                                    width: '25%',
                                    height: '10%',
                                    '2X': { width: '200px', height: '400px' },
                                    '3X': { width: '300px', height: '600px' },
                                } ]
                        }
                    ]
                }
            ]
        },
        {
            columns: [
                {
                    identifier: 'c5',
                    cashBack: { text: '', image: '', height: '', width: '' },
                    title: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    images: {
                        leafBannerId: '', listPageBannerId: '', overlayImage: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    height: '15%',
                    width: '33%',
                    '2X': { width: '200px', height: '400px' },
                    '3X': { width: '300px', height: '600px' },
                },
                {
                    identifier: 'c6',
                    cashBack: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    title: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    images: { leafBannerId: '', listPageBannerId: '', overlayImage: '' },
                    height: '15%',
                    width: '33%',
                    '2X': { width: '200px', height: '400px' },
                    '3X': { width: '300px', height: '600px' },
                },
                {
                    identifier: 'c6',
                    cashBack: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    title: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    images: { leafBannerId: '', listPageBannerId: '', overlayImage: '' },
                    height: '15%',
                    width: '33%',
                    '2X': { width: '200px', height: '400px' },
                    '3X': { width: '300px', height: '600px' },
                }
            ]
        },
        {
            columns: [
                {
                    identifier: 'c7',
                    cashBack: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    title: {
                        text: '', image: '', height: '', width: '',
                        '2X': { width: '200px', height: '400px' },
                        '3X': { width: '300px', height: '600px' },
                    },
                    images: { leafBannerId: '', listPageBannerId: '', overlayImage: '' },
                    view_all: '',
                    height: '10%',
                    width: '100%',
                    '2X': { width: '200px', height: '400px' },
                    '3X': { width: '300px', height: '600px' },
                }
            ]
        }
    ]
};


答案 1 :(得分:0)

DATE时间必须采用0001-01-01 00:00:00的格式。

  

您可以使用此字段作为字符串将CSV加载到临时文件中,   然后使用解析查询可以加载到目标表中