You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by AnilKumar B <ak...@gmail.com> on 2014/02/27 11:43:34 UTC

Multiple inputs for different avro inputs

Hi,

I am using MultipleInputs to read two different avro inputs with different
schemas.

But in run method, as we need to specify
the AvroJob.setInputKeySchema(job,schema),

Which schema I need to set?

I tried as below

            List<Schema> schemas = new ArrayList<Schema>();
schemas.add(FlumeEvent.SCHEMA$);
schemas.add(Event.SCHEMA$);
AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));

But I am facing issue while Map phase
*Error: org.apache.avro.AvroTypeException: Found Event, expecting union*

How to fix this issue?

*One more doubt: Why we don't have AvroMultipleInputs just like
AvroMultipleOutputs? Any reason?*

Thanks & Regards,
B Anil Kumar.

Re: Multiple inputs for different avro inputs

Posted by AnilKumar B <ak...@gmail.com>.
Hi Yong,

One question is that why you setInputKeySchema? Does your job load the Avro
data as the key to the following Mapper?
>> Yes, I am loading data as a key.

Thanks & Regards,
B Anil Kumar.


On Thu, Feb 27, 2014 at 7:57 PM, java8964 <ja...@hotmail.com> wrote:

> Using the Union schema is correct, which should be able to support multi
> schemas input.
>
> One question is that why you setInputKeySchema? Does your job load the
> Avro data as the key to the following Mapper?
>
> Yong
>
> ------------------------------
> Date: Thu, 27 Feb 2014 16:13:34 +0530
> Subject: Multiple inputs for different avro inputs
> From: akumarb2010@gmail.com
> To: user@hadoop.apache.org
>
>
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify
> the AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
>  schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> *Error: org.apache.avro.AvroTypeException: Found Event, expecting union*
>
> How to fix this issue?
>
> *One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?*
>
> Thanks & Regards,
> B Anil Kumar.
>

Re: Multiple inputs for different avro inputs

Posted by AnilKumar B <ak...@gmail.com>.
Hi Yong,

One question is that why you setInputKeySchema? Does your job load the Avro
data as the key to the following Mapper?
>> Yes, I am loading data as a key.

Thanks & Regards,
B Anil Kumar.


On Thu, Feb 27, 2014 at 7:57 PM, java8964 <ja...@hotmail.com> wrote:

> Using the Union schema is correct, which should be able to support multi
> schemas input.
>
> One question is that why you setInputKeySchema? Does your job load the
> Avro data as the key to the following Mapper?
>
> Yong
>
> ------------------------------
> Date: Thu, 27 Feb 2014 16:13:34 +0530
> Subject: Multiple inputs for different avro inputs
> From: akumarb2010@gmail.com
> To: user@hadoop.apache.org
>
>
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify
> the AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
>  schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> *Error: org.apache.avro.AvroTypeException: Found Event, expecting union*
>
> How to fix this issue?
>
> *One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?*
>
> Thanks & Regards,
> B Anil Kumar.
>

Re: Multiple inputs for different avro inputs

Posted by AnilKumar B <ak...@gmail.com>.
Hi Yong,

One question is that why you setInputKeySchema? Does your job load the Avro
data as the key to the following Mapper?
>> Yes, I am loading data as a key.

Thanks & Regards,
B Anil Kumar.


On Thu, Feb 27, 2014 at 7:57 PM, java8964 <ja...@hotmail.com> wrote:

> Using the Union schema is correct, which should be able to support multi
> schemas input.
>
> One question is that why you setInputKeySchema? Does your job load the
> Avro data as the key to the following Mapper?
>
> Yong
>
> ------------------------------
> Date: Thu, 27 Feb 2014 16:13:34 +0530
> Subject: Multiple inputs for different avro inputs
> From: akumarb2010@gmail.com
> To: user@hadoop.apache.org
>
>
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify
> the AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
>  schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> *Error: org.apache.avro.AvroTypeException: Found Event, expecting union*
>
> How to fix this issue?
>
> *One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?*
>
> Thanks & Regards,
> B Anil Kumar.
>

Re: Multiple inputs for different avro inputs

Posted by AnilKumar B <ak...@gmail.com>.
Hi Yong,

One question is that why you setInputKeySchema? Does your job load the Avro
data as the key to the following Mapper?
>> Yes, I am loading data as a key.

Thanks & Regards,
B Anil Kumar.


On Thu, Feb 27, 2014 at 7:57 PM, java8964 <ja...@hotmail.com> wrote:

> Using the Union schema is correct, which should be able to support multi
> schemas input.
>
> One question is that why you setInputKeySchema? Does your job load the
> Avro data as the key to the following Mapper?
>
> Yong
>
> ------------------------------
> Date: Thu, 27 Feb 2014 16:13:34 +0530
> Subject: Multiple inputs for different avro inputs
> From: akumarb2010@gmail.com
> To: user@hadoop.apache.org
>
>
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify
> the AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
>  schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> *Error: org.apache.avro.AvroTypeException: Found Event, expecting union*
>
> How to fix this issue?
>
> *One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?*
>
> Thanks & Regards,
> B Anil Kumar.
>

RE: Multiple inputs for different avro inputs

Posted by java8964 <ja...@hotmail.com>.
Using the Union schema is correct, which should be able to support multi schemas input.
One question is that why you setInputKeySchema? Does your job load the Avro data as the key to the following Mapper?
Yong

Date: Thu, 27 Feb 2014 16:13:34 +0530
Subject: Multiple inputs for different avro inputs
From: akumarb2010@gmail.com
To: user@hadoop.apache.org

Hi,
I am using MultipleInputs to read two different avro inputs with different schemas.
But in run method, as we need to specify the AvroJob.setInputKeySchema(job,schema),

Which schema I need to set?
I tried as below 
            List<Schema> schemas = new ArrayList<Schema>();		schemas.add(FlumeEvent.SCHEMA$);
		schemas.add(Event.SCHEMA$);		AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));

But I am facing issue while Map phaseError: org.apache.avro.AvroTypeException: Found Event, expecting union

How to fix this issue?
One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

Thanks & Regards,
B Anil Kumar.

 		 	   		  

Re: Multiple inputs for different avro inputs

Posted by Harsh J <ha...@cloudera.com>.
> One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

This (and other) question belongs to Apache Avro's list
(user@avro.apache.org). Moving user@hadoop to bcc:.

For AvroMultipleInputs, see https://issues.apache.org/jira/browse/AVRO-1439

On Thu, Feb 27, 2014 at 2:43 AM, AnilKumar B <ak...@gmail.com> wrote:
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify the
> AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
> schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> Error: org.apache.avro.AvroTypeException: Found Event, expecting union
>
> How to fix this issue?
>
> One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?
>
> Thanks & Regards,
> B Anil Kumar.



-- 
Harsh J

Re: Multiple inputs for different avro inputs

Posted by Harsh J <ha...@cloudera.com>.
> One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

This (and other) question belongs to Apache Avro's list
(user@avro.apache.org). Moving user@hadoop to bcc:.

For AvroMultipleInputs, see https://issues.apache.org/jira/browse/AVRO-1439

On Thu, Feb 27, 2014 at 2:43 AM, AnilKumar B <ak...@gmail.com> wrote:
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify the
> AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
> schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> Error: org.apache.avro.AvroTypeException: Found Event, expecting union
>
> How to fix this issue?
>
> One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?
>
> Thanks & Regards,
> B Anil Kumar.



-- 
Harsh J

Re: Multiple inputs for different avro inputs

Posted by Harsh J <ha...@cloudera.com>.
> One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

This (and other) question belongs to Apache Avro's list
(user@avro.apache.org). Moving user@hadoop to bcc:.

For AvroMultipleInputs, see https://issues.apache.org/jira/browse/AVRO-1439

On Thu, Feb 27, 2014 at 2:43 AM, AnilKumar B <ak...@gmail.com> wrote:
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify the
> AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
> schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> Error: org.apache.avro.AvroTypeException: Found Event, expecting union
>
> How to fix this issue?
>
> One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?
>
> Thanks & Regards,
> B Anil Kumar.



-- 
Harsh J

Re: Multiple inputs for different avro inputs

Posted by Harsh J <ha...@cloudera.com>.
> One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

This (and other) question belongs to Apache Avro's list
(user@avro.apache.org). Moving user@hadoop to bcc:.

For AvroMultipleInputs, see https://issues.apache.org/jira/browse/AVRO-1439

On Thu, Feb 27, 2014 at 2:43 AM, AnilKumar B <ak...@gmail.com> wrote:
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify the
> AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
> schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> Error: org.apache.avro.AvroTypeException: Found Event, expecting union
>
> How to fix this issue?
>
> One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?
>
> Thanks & Regards,
> B Anil Kumar.



-- 
Harsh J

Re: Multiple inputs for different avro inputs

Posted by Harsh J <ha...@cloudera.com>.
> One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

This (and other) question belongs to Apache Avro's list
(user@avro.apache.org). Moving user@hadoop to bcc:.

For AvroMultipleInputs, see https://issues.apache.org/jira/browse/AVRO-1439

On Thu, Feb 27, 2014 at 2:43 AM, AnilKumar B <ak...@gmail.com> wrote:
> Hi,
>
> I am using MultipleInputs to read two different avro inputs with different
> schemas.
>
> But in run method, as we need to specify the
> AvroJob.setInputKeySchema(job,schema),
>
> Which schema I need to set?
>
> I tried as below
>
>             List<Schema> schemas = new ArrayList<Schema>();
> schemas.add(FlumeEvent.SCHEMA$);
> schemas.add(Event.SCHEMA$);
> AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));
>
> But I am facing issue while Map phase
> Error: org.apache.avro.AvroTypeException: Found Event, expecting union
>
> How to fix this issue?
>
> One more doubt: Why we don't have AvroMultipleInputs just like
> AvroMultipleOutputs? Any reason?
>
> Thanks & Regards,
> B Anil Kumar.



-- 
Harsh J

RE: Multiple inputs for different avro inputs

Posted by java8964 <ja...@hotmail.com>.
Using the Union schema is correct, which should be able to support multi schemas input.
One question is that why you setInputKeySchema? Does your job load the Avro data as the key to the following Mapper?
Yong

Date: Thu, 27 Feb 2014 16:13:34 +0530
Subject: Multiple inputs for different avro inputs
From: akumarb2010@gmail.com
To: user@hadoop.apache.org

Hi,
I am using MultipleInputs to read two different avro inputs with different schemas.
But in run method, as we need to specify the AvroJob.setInputKeySchema(job,schema),

Which schema I need to set?
I tried as below 
            List<Schema> schemas = new ArrayList<Schema>();		schemas.add(FlumeEvent.SCHEMA$);
		schemas.add(Event.SCHEMA$);		AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));

But I am facing issue while Map phaseError: org.apache.avro.AvroTypeException: Found Event, expecting union

How to fix this issue?
One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

Thanks & Regards,
B Anil Kumar.

 		 	   		  

RE: Multiple inputs for different avro inputs

Posted by java8964 <ja...@hotmail.com>.
Using the Union schema is correct, which should be able to support multi schemas input.
One question is that why you setInputKeySchema? Does your job load the Avro data as the key to the following Mapper?
Yong

Date: Thu, 27 Feb 2014 16:13:34 +0530
Subject: Multiple inputs for different avro inputs
From: akumarb2010@gmail.com
To: user@hadoop.apache.org

Hi,
I am using MultipleInputs to read two different avro inputs with different schemas.
But in run method, as we need to specify the AvroJob.setInputKeySchema(job,schema),

Which schema I need to set?
I tried as below 
            List<Schema> schemas = new ArrayList<Schema>();		schemas.add(FlumeEvent.SCHEMA$);
		schemas.add(Event.SCHEMA$);		AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));

But I am facing issue while Map phaseError: org.apache.avro.AvroTypeException: Found Event, expecting union

How to fix this issue?
One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

Thanks & Regards,
B Anil Kumar.

 		 	   		  

RE: Multiple inputs for different avro inputs

Posted by java8964 <ja...@hotmail.com>.
Using the Union schema is correct, which should be able to support multi schemas input.
One question is that why you setInputKeySchema? Does your job load the Avro data as the key to the following Mapper?
Yong

Date: Thu, 27 Feb 2014 16:13:34 +0530
Subject: Multiple inputs for different avro inputs
From: akumarb2010@gmail.com
To: user@hadoop.apache.org

Hi,
I am using MultipleInputs to read two different avro inputs with different schemas.
But in run method, as we need to specify the AvroJob.setInputKeySchema(job,schema),

Which schema I need to set?
I tried as below 
            List<Schema> schemas = new ArrayList<Schema>();		schemas.add(FlumeEvent.SCHEMA$);
		schemas.add(Event.SCHEMA$);		AvroJob.setInputKeySchema(testJob, Schema.createUnion(schemas));

But I am facing issue while Map phaseError: org.apache.avro.AvroTypeException: Found Event, expecting union

How to fix this issue?
One more doubt: Why we don't have AvroMultipleInputs just like AvroMultipleOutputs? Any reason?

Thanks & Regards,
B Anil Kumar.