<?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>question Re: HDP Certified Java Developer practice exam in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136441#M23351</link>
    <description>&lt;P&gt;I'm not sure why you are getting that exception, but I do know that you do not need to get the path of any input files on the exam. What are you trying to do? Showing more of your code might help me to provide more insight. &lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2016 07:03:00 GMT</pubDate>
    <dc:creator>rich1</dc:creator>
    <dc:date>2016-03-21T07:03:00Z</dc:date>
    <item>
      <title>HDP Certified Java Developer practice exam</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136440#M23350</link>
      <description>&lt;P&gt;In practice exam I got classcast exception. Looks like TaggedInputSplit is not even a public class. How to get the filename when when using MultipleInputs?&lt;/P&gt;&lt;P&gt;Mapper setup method:&lt;/P&gt;&lt;P&gt;Path path = ((FileSplit) split).getPath(); &lt;/P&gt;&lt;P&gt;Driver class:&lt;/P&gt;&lt;P&gt;MultipleInputs.addInputPath(job, new Path(args[1]), TextInputFormat.class, FlightDataMapper.class);
MultipleInputs.addInputPath(job, new Path(args[2]), TextInputFormat.class, WeatherDataMapper.class); &lt;/P&gt;&lt;P&gt;Exception:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;java.lang.ClassCastException: org.apache.hadoop.mapreduce.lib.input.TaggedInputSplit cannot be cast to org.apache.hadoop.mapreduce.lib.input.FileSplit&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 06:35:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136440#M23350</guid>
      <dc:creator>ungarala</dc:creator>
      <dc:date>2016-03-21T06:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Certified Java Developer practice exam</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136441#M23351</link>
      <description>&lt;P&gt;I'm not sure why you are getting that exception, but I do know that you do not need to get the path of any input files on the exam. What are you trying to do? Showing more of your code might help me to provide more insight. &lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 07:03:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136441#M23351</guid>
      <dc:creator>rich1</dc:creator>
      <dc:date>2016-03-21T07:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Certified Java Developer practice exam</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136442#M23352</link>
      <description>&lt;P&gt;There is header in one of the CSV files and I was trying to ignore the first record. Below is my sample code.&lt;/P&gt;&lt;P&gt;setup() {&lt;/P&gt;&lt;P&gt;      Path path = ((FileSplit) split).getPath();&lt;/P&gt;&lt;P&gt;      filename = path.getName();&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;if (filename.equals("flightdata1.csv") {&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;hasheader = true;&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;map(....) {&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;if (hasheader) {&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;if (key.get() == 0) return;&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;}&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;......&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;......&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 07:16:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136442#M23352</guid>
      <dc:creator>ungarala</dc:creator>
      <dc:date>2016-03-21T07:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Certified Java Developer practice exam</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136443#M23353</link>
      <description>&lt;P&gt;An easier solution would be to read every row, and then add a check to see if it's a header row by checking one of the columns that you know only appears in a header row. &lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 07:21:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136443#M23353</guid>
      <dc:creator>rich1</dc:creator>
      <dc:date>2016-03-21T07:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Certified Java Developer practice exam</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136444#M23354</link>
      <description>&lt;P&gt;Thanks for your response &lt;A rel="user" href="https://community.cloudera.com/users/164/rich.html" nodeid="164"&gt;@Rich Raposa&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I eventually took a simpler approach to finish the exam (although 15 mins late &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;/P&gt;&lt;P&gt;I am wondering why using MultipleInputs givesTaggedInputSplit object and not FileSplit. &lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 07:35:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136444#M23354</guid>
      <dc:creator>ungarala</dc:creator>
      <dc:date>2016-03-21T07:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: HDP Certified Java Developer practice exam</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136445#M23355</link>
      <description>&lt;P&gt;There's a discussion here that answers your question. &lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="https://community.cloudera.com/"&gt;http://stackoverflow.com/questions/11130145/hadoop-multipleinputs-fails-with-classcastexception&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 07:40:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDP-Certified-Java-Developer-practice-exam/m-p/136445#M23355</guid>
      <dc:creator>rich1</dc:creator>
      <dc:date>2016-03-21T07:40:33Z</dc:date>
    </item>
  </channel>
</rss>

