Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

insert null integer into Google bigquery

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

like image 661
user1771269 Avatar asked Mar 07 '26 16:03

user1771269


1 Answers

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.

like image 114
Jordan Tigani Avatar answered Mar 10 '26 08:03

Jordan Tigani