-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
duckdb_from_timestamp throws for infinity and -infinity #10138
Comments
I think the problem here is that while |
I think the real issue is that we need |
In that case what are the minimum and maximum values that are supported by |
I don't have same issue with Also, how does Julia read infinite timestamps? duckdb/tools/juliapkg/test/test_all_types.jl Line 145 in 6b4f65a
|
Not familiar with Julia, but the values are in the timestamp.hpp header |
That's probably because you are not trying to split it into two parts? |
I call |
Ah well that's a bug! |
|
I'm not sure what you mean by meaningful but the dates that I get back from VerifyDataList<DuckDBDateOnly>("date_array", 34, new List<List<DuckDBDateOnly?>> { new(), new()
{
new DuckDBDateOnly(1970, 1, 1),
new DuckDBDateOnly(5881580, 7, 11),
new DuckDBDateOnly(-5877641, 6, 24),
null,
new DuckDBDateOnly(2022,5,12),
} }); Julia test: duckdb/tools/juliapkg/test/test_all_types.jl Line 131 in 6b4f65a
@test isequal(
df.date_array,
[
[],
[
Dates.Date(1970, 1, 1),
Dates.Date(5881580, 7, 11),
Dates.Date(-5877641, 6, 24),
missing,
Dates.Date(2022, 5, 12)
],
missing
]
) |
I mean that infinite dates can't be broken apart into year/month/day. The fact that the Julia tests work just means those tests are broken. |
I think all_types_test should have a parameter to indicate to return meaningful dates. The values returned currently cannot be represented in most programming languages. |
They can be represented in Postgres SQL. Usually we translate them into language-specific types (e.g., Python min and max dates). But when that is not possible, we usually adjust the test query (e.g., Java does not support As the Java example shows, we have no idea what the calling language supports, so a simple flag is not really possible. Another example is Python, where we support a wider range of valid dates than the This means that the onus is on the application to translate these types into something meaningful, just like they have to handle |
Python doesn't support these dates either:
If the purpose of |
I agree with @hawkfish that we should add |
Add two C APIs for detecting whether a date or a timestamp is finite. fixes: duckdb#10138 fixes: duckdblabs/duckdb-internal#1005
PR feedback: Add tests and fix API argument.
Add tests for non-infinite values.
Issue #10138: Finite Temporal Helpers
What happens?
When trying to read
infinity
and-infinity
timestamps with C Api,duckdb_from_timestamp
throws an exceptionTo Reproduce
OS:
Windows 11
DuckDB Version:
0.9.2
DuckDB Client:
C
Full Name:
Giorgi Dalakishvili
Affiliation:
Space International
Have you tried this on the latest
main
branch?I have tested with a release build (and could not test with a main build)
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
The text was updated successfully, but these errors were encountered: