Timestamp values sent to BigQuery libraries returns error "This field is not a record"

Example:

\n\n
Hashmap<String,Object> rowContent = new Hashmap<>();\nrowContent.put("Time", new Date());\nrowContent.put("Name", "Harry");\n
\n\n

Solution:

\n\n

Send the date/time as UTC seconds since 1970:

\n\n
Hashmap<String,Object> rowContent = new Hashmap<>();\nrowContent.put("Time", Math.floor(new Date().getTime()/1000));\nrowContent.put("Name", "Harry");

Ryan-Dallas

posted on

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds