-
Notifications
You must be signed in to change notification settings - Fork 182
feat(c/driver/postgresql): implement copy writer for time types #4057
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,29 @@ | |||||
| // under the License. | ||||||
|
|
||||||
|
|
||||||
| // part: metadata | ||||||
| // part: expected_schema | ||||||
|
|
||||||
| skip = "COPY Writer not implemented" | ||||||
| { | ||||||
| "format": "+s", | ||||||
| "children": [ | ||||||
| { | ||||||
| "name": "idx", | ||||||
| "format": "l", | ||||||
| "flags": ["nullable"] | ||||||
| }, | ||||||
| { | ||||||
| "name": "value", | ||||||
| "format": "ttm", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We always read microseconds, so let's expect microseconds (also the values below need to be adjusted)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| "flags": ["nullable"] | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
|
|
||||||
| // part: expected | ||||||
|
|
||||||
| {"idx": 0, "value": null} | ||||||
| {"idx": 1, "value": 0} | ||||||
| {"idx": 2, "value": 1} | ||||||
| {"idx": 3, "value": 3723123} | ||||||
| {"idx": 4, "value": 86399999} | ||||||
| {"idx": 5, "value": 86400000} | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
|
|
||
| // part: expected_schema | ||
|
|
||
| { | ||
| "format": "+s", | ||
| "children": [ | ||
| { | ||
| "name": "idx", | ||
| "format": "l", | ||
| "flags": ["nullable"] | ||
| }, | ||
| { | ||
| "name": "value", | ||
| "format": "ttu", | ||
| "flags": ["nullable"] | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| // part: expected | ||
|
|
||
| {"idx": 0, "value": null} | ||
| {"idx": 1, "value": 0} | ||
| {"idx": 2, "value": 1} | ||
| {"idx": 3, "value": 3723123456} | ||
| {"idx": 4, "value": 86399999999} | ||
| {"idx": 5, "value": 86400000000} | ||
|
Comment on lines
+37
to
+44
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears these values do not line up with what's expected (https://github.com/adbc-drivers/validation/blob/main/adbc_drivers_validation/queries/ingest/time_us.txtcase) Frankly there should be no need to override this case? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,24 @@ | |
| // under the License. | ||
|
|
||
|
|
||
| // part: metadata | ||
| // part: expected_schema | ||
|
|
||
| skip = "COPY Writer not implemented" | ||
| { | ||
| "format": "+s", | ||
| "children": [ | ||
| { | ||
| "name": "value", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Field name should be "res" |
||
| "format": "ttm", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I expect you will need microseconds here and below |
||
| "flags": ["nullable"] | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| // part: expected | ||
|
|
||
| {"value": null} | ||
| {"value": 0} | ||
| {"value": 0} | ||
| {"value": 3723123} | ||
| {"value": 86399999} | ||
| {"value": 86400000} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. If we assume the Arrow data isn't necessarily valid, don't we have to watch for overflow when we do the multiplication above? Or if we do assume the data is valid, then this can't happen, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reused the overflow validation logic of Duration or Timestamp