You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm noticing silent failure of the Postgres table scan when using an unsupported type (Kùzu doesn't tell me there's an issue, but the table isn't listed as available even though it exists in Postgres)
I have a Postgres schema in which I want to use the DECIMAL data type to represent money values correctly with exactly two decimals, and with 6 significant digits. Here's my desired schema:
CREATETABLEIF NOT EXISTS wines(
wine_id INTPRIMARY KEY,
title VARCHAR(1028) NOT NULL,
variety VARCHAR(255) NOT NULL,
points SMALLINT,
price DECIMAL(6, 2)
)
When I load this data into Postgres, I verify that the table exists, and my SQL query to list the data works.
However, when I list the table in Kùzu's Postgres extension via CALL show_tables() RETURN *, the table doesn't appear (it's not accessible via the schema cache, presumably because Kùzu doesn't correctly cast the DECIMAL type in Postgres to our internal representation of DOUBLE).
I know this is the case, because when I replace the DECIMAL(6,2) with a FLOAT8, i.e., the following schema, it works:
CREATETABLEIF NOT EXISTS wines(
wine_id INTPRIMARY KEY,
title VARCHAR(1028) NOT NULL,
variety VARCHAR(255) NOT NULL,
points SMALLINT,
price FLOAT8
)
If, for some reason, the table that exists in Postgres can't be scanned in Kùzu, we should display an appropriate error so that the user knows something is wrong. In this case, it's not clear why switching the price schema from DECIMAL(6,2) to FLOAT8 actually worked, so that's something to test out.
In the longer run, we should extend support for specialized Postgres data types (like NUMERIC or DECIMAL) as handling money values in Postgres should never be done with FLOAT4 or FLOAT8 as it's fundamentally imprecise due to floating point precision limitations. https://stackoverflow.com/questions/15726535/which-datatype-should-be-used-for-currency
The text was updated successfully, but these errors were encountered:
prrao87
added
bug
Something isn't working
usability
Issues related to better usability experience, including bad error messages
labels
May 12, 2024
The difficulty of giving a warning message to user is that: we have to propagate the warning message all the way from the extension to the physical operator which complicates the design.
Can we give them a generic warning message telling the user that: if their table has unsupported type in kuzu, the table will be ignored?
For DECIMAL type:
we are going to support DECIMAL as our internal type soon.
Yes, literally any sort of information we can provide to the user is better than providing no information (as it is currently). I think we should do what we can for now without complicating the design. Looking forward to seeing the DECIMAL data type on our side!
Hmm, ideally the user shouldn't have to specify this - it could just be a warning that one of the tables had malformed/unsupported types and the table name would just be listed so the user is aware. Choosing to skip or not skip isn't really a "useful" option in any case, until we can support all the common types 😅 .
I'm noticing silent failure of the Postgres table scan when using an unsupported type (Kùzu doesn't tell me there's an issue, but the table isn't listed as available even though it exists in Postgres)
I have a Postgres schema in which I want to use the
DECIMAL
data type to represent money values correctly with exactly two decimals, and with 6 significant digits. Here's my desired schema:When I load this data into Postgres, I verify that the table exists, and my SQL query to list the data works.
However, when I list the table in Kùzu's Postgres extension via
CALL show_tables() RETURN *
, the table doesn't appear (it's not accessible via the schema cache, presumably because Kùzu doesn't correctly cast theDECIMAL
type in Postgres to our internal representation ofDOUBLE
).I know this is the case, because when I replace the
DECIMAL(6,2)
with aFLOAT8
, i.e., the following schema, it works:Then, the table appears in Kùzu as follows:
Desirable behaviour
If, for some reason, the table that exists in Postgres can't be scanned in Kùzu, we should display an appropriate error so that the user knows something is wrong. In this case, it's not clear why switching the price schema from
DECIMAL(6,2)
toFLOAT8
actually worked, so that's something to test out.In the longer run, we should extend support for specialized Postgres data types (like
NUMERIC
orDECIMAL
) as handling money values in Postgres should never be done withFLOAT4
orFLOAT8
as it's fundamentally imprecise due to floating point precision limitations.https://stackoverflow.com/questions/15726535/which-datatype-should-be-used-for-currency
The text was updated successfully, but these errors were encountered: