You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "ml-data-analytics-jpe (via GitHub)" <gi...@apache.org> on 2025/08/18 12:19:28 UTC

[I] [Feature Request]: Support UUID column type in PostgreSQL for Hop (hop)

ml-data-analytics-jpe opened a new issue, #5624:
URL: https://github.com/apache/hop/issues/5624

   ### What would you like to happen?
   
   I extract an ID (UUID) from a JSON object, but in Hop I can only set it as a string. In my PostgreSQL database, I want the column to be of type UUID. In the Insert/Update node, during a lookup, id (string) = db.id (UUID) throws an error because Hop/Postgres cannot compare a UUID with a string. Is there a way to handle UUIDs directly in Hop? I know I could change the database column to a string, which would work, but I’d prefer to keep it as UUID.
   
   Matt Casters: "We could build a new data type plug-in for it and add support for it in pg. If you could create a feature request issue for it, we won't forget about it. I don't think it would be a lot of work to do this."
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Transforms, Component: Actions


-- 
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: issues-unsubscribe@hop.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: Support UUID column type in PostgreSQL for Hop (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
hansva closed issue #5624: [Feature Request]: Support UUID column type in PostgreSQL for Hop
URL: https://github.com/apache/hop/issues/5624


-- 
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: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: Support UUID column type in PostgreSQL for Hop (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
hansva commented on issue #5624:
URL: https://github.com/apache/hop/issues/5624#issuecomment-3266230896

   We highly encourage and appreciate any pull requests to make this happen and move the project forward. You can assign the issue to yourself using  [period]take-issue (use an actual "." but I can't write that because it would trigger the bot). This way, we know you are working on this.


-- 
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: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: Support UUID column type in PostgreSQL for Hop (hop)

Posted by "S3tuit (via GitHub)" <gi...@apache.org>.
S3tuit commented on issue #5624:
URL: https://github.com/apache/hop/issues/5624#issuecomment-3266210117

   ### Immediate workaround (Postgres):
   Add a JDBC option on your Hop PostgreSQL connection:
   ```
   Parameter: stringtype
   Value:     unspecified
   ```
   This makes pgJDBC send string params as “untyped”, so WHERE id = ? can match a uuid column. It works for me. You can also do it via UI: go over the metadata tab, select your postgres connection, go over Options.
   
   ### Devs: UUID value type plugin (as you quoted)
   Since in my company we use a lot of UUIDs this would be a great feature for us.  I’ve started a `ValueMetaUuid` plug-in under plugins/valuetypes so Hop can carry UUIDs natively (as java.util.UUID) and bind them correctly in JDBC.
   
   I implemented all the basic method of `ValueMetaBase` (setPreparedStatementValue, hashCode, compare, serialization...). It works fine with PostgreSQL (native uuid without stringtype=unspecified) and MySQL (no native uuid so it falls back to string).
   
   However, while testing I noticed that the "Table input" cannot use the new UUID type (or any other new types). In the current flow:
   ```
   // Database → build row meta from ResultSetMetaData
   for (IValueMeta vmClass : valueMetaPluginClasses) {
     IValueMeta v = vmClass.getValueFromSqlType(... rm, index, ...);
     if (v != null) { use it; break; }
   }
   ```
   In `getValueFromSqlType` there's a default that returns the type as String even if it got no matches. **It “wins” before the UUID plugin sees it, and the field comes out as String.** I don't think it'd be hard to fix but the code inside ValueMetaBase should change a tiny bit.
   
   Even if this changes, I have some worries. **Some existing pipelines may break.** Imagine a "JSON Input" (uuid String) and a "Table input" (uuid native after the change)... even if the sort and compare worked fine before, with the new UUID type users will have to change the type inside "JSON Input" to uuid (edge case, but breaking change).
   
   This can all be handled just by treating the compare and hash inside the new UUID as a String. I still have to test using H2, MSSQL, and Mongo. If it's ok for you devs I can continue the implementation.


-- 
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: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: Support UUID column type in PostgreSQL for Hop (hop)

Posted by "S3tuit (via GitHub)" <gi...@apache.org>.
S3tuit commented on issue #5624:
URL: https://github.com/apache/hop/issues/5624#issuecomment-3266268422

   .take-issue


-- 
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: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org