tuemar29
tuemar29

Reputation: 248

Convert pyarrow timestamp in ms to BigQuery timestamp

I have my timestamp in pyarrow in ms with this value: '2010-01-30 00:00:00.000000000'. I'm trying to convert it into a format that BigQuery will accept. I've tried:

but get the same error:

Failed to parse input string

I tried:

SELECT TIMESTAMP("2010-01-30 00:00:00.000000000");

got:

Invalid timestamp: '2010-01-30 00:00:00.000000000'

Tried:

SELECT FORMAT_TIMESTAMP("%c", TIMESTAMP "2010-01-30 00:00:00.000000000", "UTC") AS formatted;

Got:

Invalid TIMESTAMP literal

Upvotes: 0

Views: 92

Answers (1)

Ricco D
Ricco D

Reputation: 7287

This query worked for me:

SELECT PARSE_TIMESTAMP("%F %H:%M:%E*S", "2010-01-30 00:00:00.000000000") AS parsed;

Output:

enter image description here

Upvotes: 2

Related Questions