You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "usbrandon (via GitHub)" <gi...@apache.org> on 2023/12/21 22:38:41 UTC

[I] [Bug]: Select Transform: Trying to convert a string to a date failed. java.lang.ClassCastException (hop)

usbrandon opened a new issue, #3511:
URL: https://github.com/apache/hop/issues/3511

   ### Apache Hop version?
   
   2.7
   
   ### Java version?
   
   17
   
   ### Operating system
   
   Windows
   
   ### What happened?
   
   Originally I was inspecting the test case for duckdb which only tested Strings.  When trying to introduce a date to the pipeline I realized that there is a class problem when the Select transform tries to convert a string to a date.
   
   
   
   2023/12/21 16:28:01 - Hop - Pipeline opened.
   2023/12/21 16:28:01 - Hop - Launching pipeline [duckdb-write]...
   2023/12/21 16:28:01 - Hop - Started the pipeline execution.
   2023/12/21 16:28:01 - duckdb-write - Executing this pipeline using the Local Pipeline Engine with run configuration 'local'
   2023/12/21 16:28:01 - duckdb-write - Execution started for pipeline [duckdb-write]
   2023/12/21 16:28:01 - duckdb-write - ERROR: Execution information location 'Runs your pipelines locally with the standard local Hop pipeline engine' could not be found in the metadata
   2023/12/21 16:28:01 - generate 100k rows.0 - Finished processing (I=0, O=0, R=0, W=10, U=0, E=0)
   2023/12/21 16:28:01 - Select values 2.0 - ERROR: Unexpected error
   2023/12/21 16:28:01 - Select values 2.0 - ERROR: java.lang.ClassCastException: class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap')
   2023/12/21 16:28:01 - Select values 2.0 - 	at org.apache.hop.core.row.value.ValueMetaBase.getDate(ValueMetaBase.java:2578)
   2023/12/21 16:28:01 - Select values 2.0 - 	at org.apache.hop.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:4170)
   2023/12/21 16:28:01 - Select values 2.0 - 	at org.apache.hop.pipeline.transforms.selectvalues.SelectValues.metadataValues(SelectValues.java:344)
   2023/12/21 16:28:01 - Select values 2.0 - 	at org.apache.hop.pipeline.transforms.selectvalues.SelectValues.processRow(SelectValues.java:399)
   2023/12/21 16:28:01 - Select values 2.0 - 	at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:55)
   2023/12/21 16:28:01 - Select values 2.0 - 	at java.base/java.lang.Thread.run(Thread.java:840)
   2023/12/21 16:28:01 - Select values 2.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
   2023/12/21 16:28:01 - duckdb-write - Pipeline detected one or more transforms with errors.
   2023/12/21 16:28:01 - duckdb-write - Pipeline is killing the other transforms!
   2023/12/21 16:28:01 - fake book data.0 - Finished processing (I=0, O=0, R=10, W=10, U=0, E=0)
   2023/12/21 16:28:01 - duckdb-write - Pipeline duration : 0.063 seconds [  0.063" ]
   2023/12/21 16:28:01 - duckdb-write - Execution finished on a local pipeline engine with run configuration 'local'
   [convert_to_date_fails.zip](https://github.com/apache/hop/files/13746628/convert_to_date_fails.zip)
   
   
   ### Issue Priority
   
   Priority: 1
   
   ### Issue Component
   
   Component: Transforms, Component: Other


-- 
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]: Select Transform: Trying to convert a string to a date failed. java.lang.ClassCastException (hop)

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

   I got the cause of the problem. Basically the birthday type in the Fake data transform is generating a Date element and not a String as expected. Going to fix the issue in the Fake data transform


-- 
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]: Select Transform: Trying to convert a string to a date failed. java.lang.ClassCastException (hop)

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

   [convert_to_date_fails_in_select.zip](https://github.com/apache/hop/files/13746891/convert_to_date_fails_in_select.zip)
   This is a reproduction pipeline with no other dependencies.  


-- 
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]: Fake Data Transform: Bad metadata for dates emitting for "Date and Time"->Birthday as (String) instead of Date causes errors downstream (hop)

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

   Hey there, this fix worked well.  That is great.  Now we can have a real timestamp coming out for testing instead of just strings.
   


-- 
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]: Select Transform: Trying to convert a string to a date failed. java.lang.ClassCastException (hop)

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

   Ciao @usbrandon 
   
   The problem doesn't seems to be the Select Value but what comes out from the Fake data transform.  Try this simple pipeline, as confirmation of what I'm saying, where I forced a string representing the date you want in the same format as yours and set your format mask. The next transform, a select value, is properly transforming the string to date. Without any exception.
   
   I'm investigating if the Fake data transform is presenting wrong metadata in the output dataset (I mean a date that is already a date and not a String as expected and shown in the "Show output fields"
   
   [sample_date_convertion.zip](https://github.com/apache/hop/files/13753219/sample_date_convertion.zip)
   


-- 
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]: Fake Data Transform: Bad metadata for dates emitting for "Date and Time"->Birthday as (String) instead of Date causes errors downstream (hop)

Posted by "usbrandon (via GitHub)" <gi...@apache.org>.
usbrandon closed issue #3511: [Bug]: Fake Data Transform: Bad metadata for dates emitting for "Date and Time"->Birthday as (String) instead of Date causes errors downstream
URL: https://github.com/apache/hop/issues/3511


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