Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11
    • Component/s: grunt
    • Labels:
      None

      Description

      currently 'describe' dumps the schema in one line. If you have a long or complicated schema, it is pretty much impossible to figure out how the schema looks or what the fileds are.

      will provide an example below.

      1. PIG-2697.patch
        5 kB
        Raghu Angadi
      2. PIG-2697.patch
        5 kB
        Raghu Angadi
      3. PIG-2697-fix-0.patch
        0.7 kB
        Jonathan Coveney

        Activity

        Hide
        rangadi Raghu Angadi added a comment -

        schema for one of the structs used in Thrft unit tests :

        grunt> a = load 'x' using com.twitter.elephantbird.pig.load.ThriftPigLoader('thrift.test.Nesting');
        grunt> describe a;
        grunt> a: {my_bonk: (type: int,message: chararray),my_ooe: (im_true: int,im_false: int,a_bite: int,integer16: int,integer32: int,integer64: long,double_precision: double,some_characters: chararray,zomg_unicode: chararray,what_who: int,base64: bytearray,byte_list: {t: (byte_list_tuple: int)},i16_list: {t: (i16_list_tuple: int)},i64_list: {t: (i64_list_tuple: long)})}
        

        after:

        grunt> set pig.pretty.print.schema true;
        grunt> describe a;
        a: {
            my_bonk: (
                type: int,
                message: chararray
            ),
            my_ooe: (
                im_true: int,
                im_false: int,
                a_bite: int,
                integer16: int,
                integer32: int,
                integer64: long,
                double_precision: double,
                some_characters: chararray,
                zomg_unicode: chararray,
                what_who: int,
                base64: bytearray,
                byte_list: {
                    t: (
                        byte_list_tuple: int
                    )
                },
                i16_list: {
                    t: (
                        i16_list_tuple: int
                    )
                },
                i64_list: {
                    t: (
                        i64_list_tuple: long
                    )
                }
            )
        }
        
        Show
        rangadi Raghu Angadi added a comment - schema for one of the structs used in Thrft unit tests : grunt> a = load 'x' using com.twitter.elephantbird.pig.load.ThriftPigLoader('thrift.test.Nesting'); grunt> describe a; grunt> a: {my_bonk: (type: int ,message: chararray),my_ooe: (im_true: int ,im_false: int ,a_bite: int ,integer16: int ,integer32: int ,integer64: long ,double_precision: double ,some_characters: chararray,zomg_unicode: chararray,what_who: int ,base64: bytearray,byte_list: {t: (byte_list_tuple: int )},i16_list: {t: (i16_list_tuple: int )},i64_list: {t: (i64_list_tuple: long )})} after: grunt> set pig.pretty.print.schema true ; grunt> describe a; a: { my_bonk: ( type: int , message: chararray ), my_ooe: ( im_true: int , im_false: int , a_bite: int , integer16: int , integer32: int , integer64: long , double_precision: double , some_characters: chararray, zomg_unicode: chararray, what_who: int , base64: bytearray, byte_list: { t: ( byte_list_tuple: int ) }, i16_list: { t: ( i16_list_tuple: int ) }, i64_list: { t: ( i64_list_tuple: long ) } ) }
        Hide
        russell.jurney Russell Jurney added a comment -

        It wants they. It wants they in 0.11. Can plz to have in 0.11?

        Show
        russell.jurney Russell Jurney added a comment - It wants they. It wants they in 0.11. Can plz to have in 0.11?
        Hide
        dvryaboy Dmitriy V. Ryaboy added a comment -

        Raghu,
        This looks good, but please add the new property to the pig.properties file that ships with pig, together with comments about what it does.
        Also, that string should probably be static final instead of just inlined..

        Show
        dvryaboy Dmitriy V. Ryaboy added a comment - Raghu, This looks good, but please add the new property to the pig.properties file that ships with pig, together with comments about what it does. Also, that string should probably be static final instead of just inlined..
        Hide
        rangadi Raghu Angadi added a comment -

        saw Dmitriy's comment late.
        Added this property to pig.properties in the updated patch. Also made the string 'static final'.

        Show
        rangadi Raghu Angadi added a comment - saw Dmitriy's comment late. Added this property to pig.properties in the updated patch. Also made the string 'static final'.
        Hide
        jcoveney Jonathan Coveney added a comment -

        +1. Assuming it passes ant test-commit (#berigorousgetitright ), I'll commit.

        Show
        jcoveney Jonathan Coveney added a comment - +1. Assuming it passes ant test-commit (#berigorousgetitright ), I'll commit.
        Hide
        jcoveney Jonathan Coveney added a comment -

        It's in!

        Show
        jcoveney Jonathan Coveney added a comment - It's in!
        Hide
        julienledem Julien Le Dem added a comment -

        it seems org.apache.pig.pigunit.PigTest does not compile anymore.

            [javac] /Users/julien/svn/pig/trunk-PIG-2748/test/org/apache/pig/pigunit/PigTest.java:254: stringifySchema(java.lang.StringBuilder,org.apache.pig.impl.logicalLayer.schema.Schema,byte,int) in org.apache.pig.impl.logicalLayer.schema.Schema cannot be applied to (java.lang.StringBuilder,org.apache.pig.impl.logicalLayer.schema.Schema,byte)
            [javac]     Schema.stringifySchema(sb, pig.dumpSchema(aliasInput), DataType.TUPLE) ;
        
        Show
        julienledem Julien Le Dem added a comment - it seems org.apache.pig.pigunit.PigTest does not compile anymore. [javac] /Users/julien/svn/pig/trunk-PIG-2748/test/org/apache/pig/pigunit/PigTest.java:254: stringifySchema(java.lang.StringBuilder,org.apache.pig.impl.logicalLayer.schema.Schema,byte,int) in org.apache.pig.impl.logicalLayer.schema.Schema cannot be applied to (java.lang.StringBuilder,org.apache.pig.impl.logicalLayer.schema.Schema,byte) [javac] Schema.stringifySchema(sb, pig.dumpSchema(aliasInput), DataType.TUPLE) ;
        Hide
        jcoveney Jonathan Coveney added a comment -

        Julien,

        I was not able to reproduce this. Can you try to give me specifics on how to reproduce?

        Show
        jcoveney Jonathan Coveney added a comment - Julien, I was not able to reproduce this. Can you try to give me specifics on how to reproduce?
        Hide
        jcoveney Jonathan Coveney added a comment -

        Good call Julien. Not sure how this happened as I ran the tests, but shrug. This fixes it.

        Show
        jcoveney Jonathan Coveney added a comment - Good call Julien. Not sure how this happened as I ran the tests, but shrug . This fixes it.
        Hide
        julienledem Julien Le Dem added a comment -

        +1

        Show
        julienledem Julien Le Dem added a comment - +1
        Hide
        jcoveney Jonathan Coveney added a comment -

        Fix is in. Thanks Julien.

        Show
        jcoveney Jonathan Coveney added a comment - Fix is in. Thanks Julien.

          People

          • Assignee:
            rangadi Raghu Angadi
            Reporter:
            rangadi Raghu Angadi
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development