Coder Social home page Coder Social logo

Comments (10)

costin avatar costin commented on June 21, 2024

Can you upload a small snippet of your data set so I can replicate the problem on my side? Just upload it somewhere since I'm not sure Github can handle attachments and posting here might cause whitespace problems.

from elasticsearch-hadoop.

bwmeier avatar bwmeier commented on June 21, 2024

I added a short (1 result) json document that shows the result from an elasticsearch query on my system. The result set contains an array in lines 19, 22, and 23, any of which will cause the problem.

https://github.com/bwmeier/elasticsearch-hadoop/blob/master/elasticsearch_array_result.json

If you have any questions about the result, let me know.

from elasticsearch-hadoop.

costin avatar costin commented on June 21, 2024

@bwmeier the problem should be fixed in master. As @tzolov pointed out, there was a bug in parsing arrays into proper Writables causing the default, byte array serialization, to occur.
This should be now fix. Please try it out and let me know if that's not the case.

from elasticsearch-hadoop.

bwmeier avatar bwmeier commented on June 21, 2024

The error's changed slightly, but not significantly. I now get the following exception trace, which again looks like the array processing, just with the ArrayList type instead of the Byte[]. I suspect that pig needs a translation from ArrayList to DataBag, or something of the sort, since the message is related to "standard Pig type".

2013-04-19 12:12:04,057 WARN org.apache.hadoop.mapred.Child: Error running child
java.lang.RuntimeException: Unexpected data type java.util.ArrayList found in stream. Note only standard Pig type is supported when you output from UDF/LoadFunc
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:559)
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:435)
    at org.apache.pig.data.BinInterSedes.writeMap(BinInterSedes.java:581)
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:451)
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:435)
    at org.apache.pig.data.BinInterSedes.writeMap(BinInterSedes.java:581)
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:451)
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:435)
    at org.apache.pig.data.utils.SedesHelper.writeGenericTuple(SedesHelper.java:135)
    at org.apache.pig.data.BinInterSedes.writeTuple(BinInterSedes.java:613)
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:443)
    at org.apache.pig.data.BinInterSedes.writeDatum(BinInterSedes.java:435)
    at org.apache.pig.impl.io.InterRecordWriter.write(InterRecordWriter.java:73)
    at org.apache.pig.impl.io.InterStorage.putNext(InterStorage.java:87)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat$PigRecordWriter.write(PigOutputFormat.java:139)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat$PigRecordWriter.write(PigOutputFormat.java:98)
    at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.write(MapTask.java:559)
    at org.apache.hadoop.mapreduce.task.TaskInputOutputContextImpl.write(TaskInputOutputContextImpl.java:85)
    at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.write(WrappedMapper.java:106)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapOnly$Map.collect(PigMapOnly.java:48)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.runPipeline(PigGenericMapBase.java:285)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:278)
    at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:64)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:140)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:673)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:331)
    at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
    at org.apache.hadoop.mapred.Child.main(Child.java:262)

from elasticsearch-hadoop.

costin avatar costin commented on June 21, 2024

Understood - I've reopened the issue and will try to address it by next week.

from elasticsearch-hadoop.

bwmeier avatar bwmeier commented on June 21, 2024

Thanks @costin, I appreciate the work. I'll test this out when I get the chance, but it won't be for a few days :-)

from elasticsearch-hadoop.

costin avatar costin commented on June 21, 2024

Hi Boyd,

I think I've found (and fixed) the issue. Pig complex types were not handled properly when reading them back from Pig. Note that the conversion (not just for Pig but Hive, M/R etc...) will be overhauled however it should be working just fine now - the only issue is that bags are converted to tuples when are deserialized (and that's because we don't hold yet any extra information to allow us to differentiate between tuple and bags).
However this is something we plan to fix in the future.

It would be great if you could try out the latest master - see the readme on how to get the latest nightly build (I've just pushed one right now: http://build.elasticsearch.org/browse/ESHADOOP-NIGHTLY-40

from elasticsearch-hadoop.

bwmeier avatar bwmeier commented on June 21, 2024

Hi Costin, I've been on vacation since the 3rd, so I'm just now getting the
chance to look at this. I'll test it out and get back to you :-)

On Sat, May 4, 2013 at 3:19 AM, Costin Leau [email protected]:

Hi Boyd,

I think I've found (and fixed) the issue. Pig complex types were not
handled properly when reading them back from Pig. Note that the conversion
(not just for Pig but Hive, M/R etc...) will be overhauled however it
should be working just fine now - the only issue is that bags are converted
to tuples when are deserialized (and that's because we don't hold yet any
extra information to allow us to differentiate between tuple and bags).
However this is something we plan to fix in the future.

It would be great if you could try out the latest master - see the readme
on how to get the latest nightly build (I've just pushed one right now:
http://build.elasticsearch.org/browse/ESHADOOP-NIGHTLY-40


Reply to this email directly or view it on GitHubhttps://github.com//issues/36#issuecomment-17429716
.

from elasticsearch-hadoop.

bwmeier avatar bwmeier commented on June 21, 2024

Costin, the fix works. However, the performance is pretty poor - I was able to process 37500 records and write them to JsonStorage, but it took about 45 minutes, I'm not sure if it's related to the fix or not.

I tested the version of the fix pointed to by that commit, I have not tested anything later than that.

from elasticsearch-hadoop.

costin avatar costin commented on June 21, 2024

Note that there's an upcoming serialization improvement for writing to ES coming hopefully in the next few days.
It sounds though as this is not what you're doing - can you share your test (through a gist/email/pm maybe)?
You mention JsonStorage but I'm not sure why you would want to use since it adds the overhead of converting to JSON which we already handle.
Can you explain your use case more?

from elasticsearch-hadoop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.