fskorgen commented on PR #8244:
URL: https://github.com/apache/hop/pull/8244#issuecomment-5605346548

   I tested this against live databases, since #8216 is mine and these dialects
   are not covered by CI.
   
   The column is identical on every database, `DECIMAL(18,6)` holding
   `123456789012.123456`, created with plain SQL. All of them store it exactly,
   so the only variable is Hop. Measured on `main` at 9925b3f652, with and
   without this PR.
   
   **Before, on current `main` — all four wrong:**
   
   | Database | Column | Hop reads as | Value | `getFieldDefinition` writes |
   |---|---|---|---|---|
   | MSSQL | `decimal(18,6)` | `Number(12,6)` | rounded | `DECIMAL(12,6)` |
   | MonetDB | `decimal(18,6)` | `Number(12,6)` | rounded | `DOUBLE` |
   | PostgreSQL | `numeric(18,6)` | `Number(12,6)` | rounded | `NUMERIC(18,6)` |
   | Infobright | `DECIMAL(18,6)` | `Number(12,6)` | rounded | `DOUBLE` |
   
   Two separate consequences. The value loses digits everywhere. And on MSSQL a
   Table Input to Table Output copy produces a target column four digits too
   narrow for the data the source held; MonetDB and Infobright lose the exact
   type entirely. PostgreSQL keeps its shape only because its writer adds the
   scale back, `12 + 6 = 18`, cancelling the subtraction.
   
   **After, with this PR — all four correct:**
   
   | Database | Hop reads as | Value | writes |
   |---|---|---|---|
   | MSSQL | `BigNumber(18,6)` | exact | `DECIMAL(18,6)` |
   | MonetDB | `BigNumber(18,6)` | exact | `DECIMAL(18,6)` |
   | PostgreSQL | `BigNumber(18,6)` | exact | `NUMERIC(18,6)` |
   | Infobright | `BigNumber(18,6)` | exact | `DECIMAL(18,6)` |
   
   Nothing left over that I can see: value, derived type and round-tripped
   column are all right on every dialect I have.
   
   Also ran core plus the six modules this PR touches, 1301 tests, with and
   without it. Four classes fail either way (config serialization, OIDC, VFS
   network providers, JDBC characterization), so none is caused by this PR.
   
   Scope: I only tested type mapping, and only these dialects. Infobright is
   not a Hop dialect, so it was read through MARIADB.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to