在Google BigQuery中插入空整数 [英] insert null integer into Google bigquery

查看:90
本文介绍了在Google BigQuery中插入空整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将记录导入从mysql导出的bigquery表。

数据导出为csv,但必须用制表符'\ t'分隔,因为有些字段将json文件存储为字符串,所以普通分隔符将不起作用。



在mysql中,一些字段( integer float )是 null ,但在导出时显示为\N。



例如:


123 456'2.2.0.159''monday''London''GB'\N 1026 0


我试图将\ N替换为 null (也试过 NULL Null ,所有这些都不起作用)并上传到大查询中,但出现以下错误:


行:1 /字段:7,值无法转换为预期的类型

什么是在bigquery中的语法允许我将值作为空值导入?



非常感谢

解决方案

尝试一个空的领域 - 例如对于csv,只需 ,, 。或为tsv, \t\t 。如果这是MySql使用的语法,我们应该添加对\N的支持。


I am trying to import records to bigquery table which exported from mysql.

The data is exported as csv but has to be separated by tabs '\t' as some fields store json file as string, so the normal separator won't work.

From mysql, some fields (integer, float) are null but are shown as \N when exported.

For example:

123 456 '2.2.0.159' 'monday' 'London' 'GB' \N 1026 0

I am trying to replace \N as null(also tried NULL, Null, all of them are not working) and upload to big query but I'm getting the following error:

Line:1 / Field:7, Value cannot be converted to expected type

What is the syntax in bigquery to allow me to import a value as null?

Many thanks

解决方案

Try an empty field -- e.g. for csv, just ,,. or for tsv, \t\t. We should likely add support for \N if that is the syntax used by MySql.

这篇关于在Google BigQuery中插入空整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆