You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "der-michael (via GitHub)" <gi...@apache.org> on 2025/10/27 11:02:47 UTC

[I] [Bug]: PostgreSQL Bulk Loader Boolean problem with Table Input. (hop)

der-michael opened a new issue, #5912:
URL: https://github.com/apache/hop/issues/5912

   ### Apache Hop version?
   
   2.15.0
   
   ### Java version?
   
   openjdk version "21.0.8" 2025-07-15 LTS
   
   ### Operating system
   
   Windows
   
   ### What happened?
   
   If a boolean field is recognized by HOP in a Table Input it leads to errors in the PostgreSQL Bulk Loader. It can easily be reproduced like so:
   
   1. Create a source table
   `CREATE TABLE postgresbool_src ( textfield varchar(20) NULL, boolfield bool NULL);` 
   
   2. Insert Data
   `INSERT INTO postgresbool_src 
   (textfield, boolfield) VALUES('test01', false);`
   
   3. Create a target table
   `CREATE TABLE postgresbool ( textfield varchar(20) NULL, boolfield bool NULL);`
   
   If loaded directly from Table Input to PostgreSQL Bulk Loader this error appears:
   
   > 2025/10/27 11:51:37 - PostgreSQL Bulk Loader.0 - ERROR: Error in transform
   > 2025/10/27 11:51:37 - PostgreSQL Bulk Loader.0 - ERROR: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type boolean: "1.0"
   >   Where: COPY postgresbool, line 1, column boolfield: "1.0"
   
   My interpretation here would be that the HOP internal value for bool gets misinterpreted or transformed to 1.0 instead of 1 which PostgreSQL Loader cannot read directly as stated in documentation [1].
   
   The error can be mitigated by changing the data type to string (i.e. via Select Values transform) or using the Table Output object. Both work arounds have an impact on performance and take more time to set up. The same problem does not appear if read from CSV Input - I have seen the same behaviour with Salesforce Input however.
   
   I have opened a stackoverflow thread [2] no one was able to answer and then found that this bug apparently already existed years ago in Pentaho [3].
   
   [1] https://www.postgresql.org/docs/current/datatype-boolean.html
   [2] https://stackoverflow.com/questions/79798449/apache-hop-postgresql-bulk-loader-boolean-bug
   [3] https://stackoverflow.com/questions/48748360/pentaho-cannot-import-boolean-value-to-table-with-postgresql-bulk-loader?rq=2
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: Transforms


-- 
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] [Bug]: PostgreSQL Bulk Loader Boolean problem with Table Input. (hop)

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

   .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


Re: [I] [Bug]: PostgreSQL Bulk Loader Boolean problem with Table Input. (hop)

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

   Thanks for reporting. This is likely caused by the fact that we have to convert all our types to a string to make the file to do the insertion.


-- 
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] [Bug]: PostgreSQL Bulk Loader Boolean problem with Table Input. (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
hansva closed issue #5912: [Bug]: PostgreSQL Bulk Loader Boolean problem with Table Input.
URL: https://github.com/apache/hop/issues/5912


-- 
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