-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Starting with an existing schema, epoch time cannot mismatched type TIMESTAMP --> INTEGER #64
Comments
Thinking about this more, since we don't have the full record I think it would be better to in the |
I understand it might be useful in your situation, but I'm not sure that a INTEGER -> TIMESTAMP conversion is the correct behavior because
|
@bxparks I agree autodetection doesn't do this, but BigQuery load does support loading epoch data into a TIMESTAMP field in a schema if you provide the schema during load. With an added flag for this would you be in favor of me fixing this? Something like |
Oh, I see. Although |
(And you explained that same thing in your comment, but for some reason, the email version of that truncated the 1st paragraph, so I saw only your last sentence.) |
Re: the email, That was my bad where I made a more descriptive edit to the comment. I'll work on implementing this additional flag and i'll make sure to have some tests for it of course. |
Current Behavior
When starting with an existing bigquery schema that has a TIMESTAMP field in it we get an error when trying to load logs which contain an epoch time as this is detected as an INTEGER and we get the following error:
Expected Behavior
If this timestamp matched the correct number of digits for an epoch timestamp which is supported by bigquery we should be able to assume that this INTEGER is in fact a TIMESTAMP and allow it to be maintained as such.
Suggested solution
Add a new if block to the
convert_type
function which will allow btype = TIMESTAMP and atype = INTEGER to return TIMESTAMP if the integer matches the correct number of digits for an epoch time.There is added complexity because we do not pass the actual data for the record into this function. We may need to start doing this.
The text was updated successfully, but these errors were encountered: