0

I am using DOM parser to parse an XML. The xml format is :

<PriceList>
        <PriceTag>
            <Pricing priceCode = "EATIN">
                <Price></Price>
                <Tax
                    taxCode = "ALWAYS"
                    rule = "TAX_CHAIN"
                    entry = "4"/>
            </Pricing>
            <Pricing priceCode = "TAKEOUT">
                <Price></Price>
                <Tax
                    taxCode = "ALWAYS"
                    rule = "TAX_CHAIN"
                    entry = "4"/>
            </Pricing>
            <Pricing priceCode = "OTHER">
                <Price></Price>
                <Tax
                    taxCode = "ALWAYS"
                    rule = "TAX_CHAIN"
                    entry = "4"/>
            </Pricing>
        </PriceTag>
    </PriceList>

If the priceCode = "EATIN", I want to read the price.

Can any one help me to implement this.

  • Have you checked this? http://stackoverflow.com/questions/11130145/hadoop-multipleinputs-fails-with-classcastexception – proutray Sep 03 '15 at 17:04
  • yes, I tried this, but still I am having the same issue –  Sep 03 '15 at 18:27

1 Answers1

0

Try replacing this line fileName = ((FileSplit)context.getInputSplit()).getPath().toString(); with fileName = context.getConfiguration().get("mapreduce.input.fileinputformat.inpu‌​tdir", null);

proutray
  • 1,943
  • 3
  • 30
  • 48