Grokbase Groups Pig user October 2010
FAQ
What would be the right syntax to stream through a python script?

This does not seem to work, as pig complains about the syntax:
DEFINE force_layout `ForceDirected.py`
SHIP ('$python_dir/ForceDirected.py');
layout = STREAM connection_info THROUGH force_layout
AS (user_id:chararray, nodes:bag{t:tuple(x:int, y:int, created:int)}, edges:bag{t:tuple(source:int, destination:int)});


[java] 10/10/11 18:55:05 ERROR python_script_runner: 2010-10-11 18:55:05,729 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " <PATH> "user_id, "" at line 7, column 1.


Thanks for your help!

-Sal Uryasev

Search Discussions

  • Sal Uryasev at Oct 12, 2010 at 10:04 pm
    This actually is the correct syntax for getting a bag out of a python stream. The error was getting thrown elsewhere in the file with a similar 'user_id', and I did not notice. Thanks for your help!
    On Oct 11, 2010, at 7:04 PM, Sal Uryasev wrote:

    What would be the right syntax to stream through a python script?

    This does not seem to work, as pig complains about the syntax:
    DEFINE force_layout `ForceDirected.py`
    SHIP ('$python_dir/ForceDirected.py');
    layout = STREAM connection_info THROUGH force_layout
    AS (user_id:chararray, nodes:bag{t:tuple(x:int, y:int, created:int)}, edges:bag{t:tuple(source:int, destination:int)});


    [java] 10/10/11 18:55:05 ERROR python_script_runner: 2010-10-11 18:55:05,729 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " <PATH> "user_id, "" at line 7, column 1.


    Thanks for your help!

    -Sal Uryasev

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedOct 12, '10 at 2:04a
activeOct 12, '10 at 10:04p
posts2
users1
websitepig.apache.org

1 user in discussion

Sal Uryasev: 2 posts

People

Translate

site design / logo © 2021 Grokbase