<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ClassCastException in Dynamic Schema in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/ClassCastException-in-Dynamic-Schema/m-p/2297694#M70238</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am trying to use tSetDynamicSchema to check the dynamic schema definition feature of Talend.&lt;/P&gt;&lt;P&gt;I have defined the following schema metadata in a CSV file which the job reads&amp;nbsp;using&amp;nbsp;tFileInputDelimited and passes on the read data to tSetDynamicSchema.&lt;/P&gt;&lt;PRE&gt;NAME,TYPE,LENGTH
AUTHOR_ID,id_String,384
NAME,id_String,100
INITIALS,id_String,10
CREATE_DATE,id_Date,7
NOTES,id_String,250
CREATED_BY,id_String,20&lt;/PRE&gt;&lt;P&gt;The job then tries to read the input file (another CSV file) using tFileInputPositional component where I have specified the tSetDynamicSchema&amp;nbsp; as the existing dynamic.&lt;/P&gt;&lt;P&gt;The data read from tFileInputPositional is then printed on the console using tLogRow and then written to a database table.&lt;/P&gt;&lt;P&gt;However I am getting the following error when running the job:&lt;/P&gt;&lt;PRE&gt;Exception in component tLogRow_1
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
	at routines.system.DynamicUtils.formatDate(DynamicUtils.java:443)
	at routines.system.Dynamic.toString(Dynamic.java:189)
	at routines.system.Dynamic.toString(Dynamic.java:180)
	at java.lang.String.valueOf(Unknown Source)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.tFileInputPositional_1Process(testDynamicSchema.java:2307)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.tFileInputDelimited_1Process(testDynamicSchema.java:1278)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.runJobInTOS(testDynamicSchema.java:7092)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.main(testDynamicSchema.java:6830)
[FATAL]: etl_dev.testdynamicschema_0_1.testDynamicSchema - tLogRow_1 java.lang.String cannot be cast to java.util.Date&lt;/PRE&gt;&lt;P&gt;I know it is because I have defined the datatype for CREATE_DATE field as id_Date. I would like to know if there is any other way to specify DateTime datatype for a column for tSetDynamicSchema.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 08:20:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T08:20:29Z</dc:date>
    <item>
      <title>ClassCastException in Dynamic Schema</title>
      <link>https://community.qlik.com/t5/Talend-Studio/ClassCastException-in-Dynamic-Schema/m-p/2297694#M70238</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am trying to use tSetDynamicSchema to check the dynamic schema definition feature of Talend.&lt;/P&gt;&lt;P&gt;I have defined the following schema metadata in a CSV file which the job reads&amp;nbsp;using&amp;nbsp;tFileInputDelimited and passes on the read data to tSetDynamicSchema.&lt;/P&gt;&lt;PRE&gt;NAME,TYPE,LENGTH
AUTHOR_ID,id_String,384
NAME,id_String,100
INITIALS,id_String,10
CREATE_DATE,id_Date,7
NOTES,id_String,250
CREATED_BY,id_String,20&lt;/PRE&gt;&lt;P&gt;The job then tries to read the input file (another CSV file) using tFileInputPositional component where I have specified the tSetDynamicSchema&amp;nbsp; as the existing dynamic.&lt;/P&gt;&lt;P&gt;The data read from tFileInputPositional is then printed on the console using tLogRow and then written to a database table.&lt;/P&gt;&lt;P&gt;However I am getting the following error when running the job:&lt;/P&gt;&lt;PRE&gt;Exception in component tLogRow_1
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
	at routines.system.DynamicUtils.formatDate(DynamicUtils.java:443)
	at routines.system.Dynamic.toString(Dynamic.java:189)
	at routines.system.Dynamic.toString(Dynamic.java:180)
	at java.lang.String.valueOf(Unknown Source)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.tFileInputPositional_1Process(testDynamicSchema.java:2307)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.tFileInputDelimited_1Process(testDynamicSchema.java:1278)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.runJobInTOS(testDynamicSchema.java:7092)
	at etl_dev.testdynamicschema_0_1.testDynamicSchema.main(testDynamicSchema.java:6830)
[FATAL]: etl_dev.testdynamicschema_0_1.testDynamicSchema - tLogRow_1 java.lang.String cannot be cast to java.util.Date&lt;/PRE&gt;&lt;P&gt;I know it is because I have defined the datatype for CREATE_DATE field as id_Date. I would like to know if there is any other way to specify DateTime datatype for a column for tSetDynamicSchema.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 08:20:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/ClassCastException-in-Dynamic-Schema/m-p/2297694#M70238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T08:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: ClassCastException in Dynamic Schema</title>
      <link>https://community.qlik.com/t5/Talend-Studio/ClassCastException-in-Dynamic-Schema/m-p/2297695#M70239</link>
      <description>&lt;P&gt;Another addition is that when I changed the datatype of the CREATE_DATE field to id_String, I did not get any error.&lt;/P&gt; 
&lt;P&gt;However all the data read from the file was written to a single (first) column of the database table. How can&amp;nbsp;I make the job output the data read to the correct columns?&lt;/P&gt; 
&lt;P&gt;Attaching a screenshot of the job I have created&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DynamicSchema.png" style="width: 611px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lx1D.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129270iB79E51051EF7721F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lx1D.png" alt="0683p000009Lx1D.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 11:31:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/ClassCastException-in-Dynamic-Schema/m-p/2297695#M70239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-26T11:31:18Z</dc:date>
    </item>
  </channel>
</rss>

