You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hcatalog-commits@incubator.apache.org by ga...@apache.org on 2012/03/16 22:48:44 UTC

svn commit: r1301811 - in /incubator/hcatalog/trunk: CHANGES.txt src/test/e2e/hcatalog/conf/default.conf src/test/e2e/hcatalog/tests/hadoop.conf src/test/e2e/hcatalog/tests/hive.conf src/test/e2e/hcatalog/tests/pig.conf

Author: gates
Date: Fri Mar 16 22:48:44 2012
New Revision: 1301811

URL: http://svn.apache.org/viewvc?rev=1301811&view=rev
Log:
HCATALOG-306 Need more end-to-end tests

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/src/test/e2e/hcatalog/conf/default.conf
    incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hadoop.conf
    incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hive.conf
    incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/pig.conf

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1301811&r1=1301810&r2=1301811&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Fri Mar 16 22:48:44 2012
@@ -66,6 +66,8 @@ Release 0.4.0 - Unreleased
   HCAT-2 Support nested schema conversion between Hive an Pig (julienledem via hashutosh)
 
   IMPROVEMENTS
+  HCAT-306 Need more end-to-end tests (gates)
+
   HCAT-130 Documentation improvements (gates and lefty via gates)
 
   HCAT-266 Upgrade HBase dependency to 0.92 (thw via toffer)

Modified: incubator/hcatalog/trunk/src/test/e2e/hcatalog/conf/default.conf
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/e2e/hcatalog/conf/default.conf?rev=1301811&r1=1301810&r2=1301811&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/test/e2e/hcatalog/conf/default.conf (original)
+++ incubator/hcatalog/trunk/src/test/e2e/hcatalog/conf/default.conf Fri Mar 16 22:48:44 2012
@@ -62,7 +62,7 @@ $cfg = {
     , 'hcat_data_dir'    => '/user/hcat/tests/data'
     , 'hivehome'          => $ENV{'PH_HIVE_HOME'}
     , 'hcathome'          => $ENV{'HCAT_INSTALL_DIR'}
-    , 'hcatalog.jar' => "$ENV{HCAT_JAR},$ENV{HIVE_ROOT}/build/dist/lib/hive-serde-$hive_version.jar,$ENV{HIVE_ROOT}/build/dist/lib/hive-exec-$hive_version.jar,$ENV{PIG_HOME}/pig-0.9.2-withouthadoop.jar,$ENV{HIVE_ROOT}/build/dist/lib/hive-metastore-$hive_version.jar,$ENV{HIVE_ROOT}/build/dist/lib/libfb303-0.7.0.jar,$ENV{HIVE_ROOT}/build/dist/lib/jdo2-api-2.3-ec.jar,$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/hbase-0.92.0-SNAPSHOT.jar,$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/zookeeper-3.4.3.jar,$ENV{HCAT_ROOT}/storage-handlers/hbase/build/hbase-storage-handler/hbase-storage-handler-0.1.0.jar,$ENV{HCAT_ROOT}/hive/external/build/dist/lib/hive-hbase-handler-$hive_version.jar"
+    , 'hcatalog.jar' => "$ENV{HCAT_JAR},$ENV{HIVE_ROOT}/build/dist/lib/hive-serde-$hive_version.jar,$ENV{HIVE_ROOT}/build/dist/lib/hive-exec-$hive_version.jar,$ENV{PIG_HOME}/pig-0.9.2-withouthadoop.jar,$ENV{HIVE_ROOT}/build/dist/lib/hive-metastore-$hive_version.jar,$ENV{HIVE_ROOT}/build/dist/lib/libfb303-0.7.0.jar,$ENV{HIVE_ROOT}/build/dist/lib/jdo2-api-2.3-ec.jar,$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/hbase-0.92.1-SNAPSHOT.jar,$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/zookeeper-3.4.3.jar,$ENV{HCAT_ROOT}/storage-handlers/hbase/build/hbase-storage-handler/hbase-storage-handler-0.1.0.jar,$ENV{HCAT_ROOT}/hive/external/build/dist/lib/hive-hbase-handler-$hive_version.jar"
 
     #PIG
     , 'testconfigpath'   => "$ENV{PH_CLUSTER}"
@@ -72,7 +72,7 @@ $cfg = {
     , 'pigpath'          => "$ENV{PIG_HOME}"
     , 'pigjar'           => "$ENV{PIG_JAR}" # Pig jar that doesn't have Antlr
     , 'oldpigpath'       => "$ENV{PH_OLDPIG}"
-    , 'additionaljars' => "$ENV{HCAT_ROOT}/build/hcatalog/hcatalog-0.5.0.jar:$ENV{HCAT_ROOT}/hive/external/build/metastore/hive-metastore-$hive_version.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/libthrift.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/hive-exec-$hive_version.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/libfb303.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/jdo2-api-2.3-ec.jar::$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/hbase-0.92.0-SNAPSHOT.jar:$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/zookeeper-3.4.3.jar:$ENV{HCAT_ROOT}/storage-handlers/hbase/build/hbase-storage-handler/hbase-storage-handler-0.1.0.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/hive-hbase-handler-$hive_version.jar:$ENV{'HCAT_INSTALL_DIR'}/etc/hcatalog"
+    , 'additionaljars' => "$ENV{HCAT_ROOT}/build/hcatalog/hcatalog-0.5.0.jar:$ENV{HCAT_ROOT}/hive/external/build/metastore/hive-metastore-$hive_version.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/libthrift.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/hive-exec-$hive_version.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/libfb303.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/jdo2-api-2.3-ec.jar::$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/hbase-0.92.1-SNAPSHOT.jar:$ENV{HCAT_ROOT}/storage-handlers/hbase/build/ivy/lib/hbase-storage-handler/zookeeper-3.4.3.jar:$ENV{HCAT_ROOT}/storage-handlers/hbase/build/hbase-storage-handler/hbase-storage-handler-0.1.0.jar:$ENV{HCAT_ROOT}/hive/external/build/dist/lib/hive-hbase-handler-$hive_version.jar:$ENV{'HCAT_INSTALL_DIR'}/etc/hcatalog"
 
     #HADOOP
     , 'hadoopHome'       => "$ENV{HCAT_ROOT}/lib"

Modified: incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hadoop.conf
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hadoop.conf?rev=1301811&r1=1301810&r2=1301811&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hadoop.conf (original)
+++ incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hadoop.conf Fri Mar 16 22:48:44 2012
@@ -197,7 +197,24 @@ jar :FUNCPATH:/testudf.jar org.apache.hc
                                 ,'sql' => q\select name, age, floor(gpa) + 0.1 from all100krc;\
                                 ,'floatpostprocess' => 1
                                 ,'delimiter' => '	'
-                                },
+                                },{
+                                 'num' => 4
+                                ,'hcat_prep' => q\
+drop table if exists hadoop_write_4;
+create table hadoop_write_4(
+            name string,
+            age int,
+            gpa double)
+stored as sequencefile;
+\,
+                                ,'hadoop' => q\
+jar :FUNCPATH:/testudf.jar org.apache.hcatalog.utils.WriteRC -libjars :HCAT_JAR: :THRIFTSERVER: all100krc hadoop_write_4
+\,
+                                ,'result_table' => 'hadoop_write_4'
+                                ,'sql' => q\select name, age, floor(gpa) + 0.1 from all100krc;\
+                                ,'floatpostprocess' => 1
+                                ,'delimiter' => '	'
+                                }
                         ],
                 }, # end g
                 {

Modified: incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hive.conf
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hive.conf?rev=1301811&r1=1301810&r2=1301811&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hive.conf (original)
+++ incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/hive.conf Fri Mar 16 22:48:44 2012
@@ -111,6 +111,22 @@ $cfg = {
                     'name' => 'Hive_Read',
                     'tests' => [ {
                         'num' => 1,
+                         # float and double columns removed because mysql and hive can't agree 
+                         # on how to round, even using floor/truncate functions
+                         'sql' => q\select t, si, i, b, s from all100k;\,
+                         'verify_sql' => q\select t, si, i, b, s from all100k;\,
+                         'floatpostprocess' => 1,
+                         'delimiter' => '	',
+                         },{
+                        'num' => 2,
+                         # double column removed because mysql and hive can't agree 
+                         # on how to round, even using floor/truncate functions
+                         'sql' => q\select i, s from all100kjson;\,
+                         'verify_sql' => q\select i, s from all100kjson;\,
+                         'floatpostprocess' => 1,
+                         'delimiter' => '	',
+                         },{
+                        'num' => 3,
                          'sql' => q\select name, age, floor(gpa) from all100krc;\,
                          'verify_sql' => q\select name, age, truncate(gpa, 0) from all100krc;\,
                          'floatpostprocess' => 1,
@@ -121,12 +137,44 @@ $cfg = {
                     'name' => 'Hive_Write',
                     'tests' => [ {
                         'num' => 1,
+                         # float and double columns removed because mysql and hive can't agree 
+                         # on how to round, even using floor/truncate functions
                          'sql' => q\
 drop table if exists hive_write_1;
-create table hive_write_1 (name string, age int, gpa double) stored as rcfile;
-insert into TABLE hive_write_1 select name, age, floor(gpa) + 0.1 from all100krc;\,
+create table hive_write_1 (t tinyint, si smallint, i int, b bigint, s string) row format delimited stored as textfile;
+insert into TABLE hive_write_1 select t, si, i, b, s from all100k;\,
                          'result_table' => 'hive_write_1',
-                         'verify_sql' =>"select name, age, floor(gpa) + 0.1 from all100krc;",
+                         'verify_sql' => q\select t, si, i, b, s from all100k;\,
+                         'floatpostprocess' => 1,
+                         'delimiter' => '	',
+                    },{
+                        'num' => 2,
+                         'sql' => q\
+drop table if exists hive_write_2;
+create table hive_write_2 (name string, age int, gpa double) row format serde 'org.apache.hcatalog.data.JsonSerDe' stored as textfile;
+insert into TABLE hive_write_2 select s, i, 0.1 from all100kjson;\,
+                         'result_table' => 'hive_write_2',
+                         'verify_sql' =>"select s, i, 0.1 from all100kjson;",
+                         'floatpostprocess' => 1,
+                         'delimiter' => '	',
+                    },{
+                        'num' => 3,
+                         'sql' => q\
+drop table if exists hive_write_3;
+create table hive_write_3 (name string, age int, gpa double) stored as rcfile;
+insert into TABLE hive_write_3 select name, age, 1.1 from all100krc;\,
+                         'result_table' => 'hive_write_3',
+                         'verify_sql' =>"select name, age, 1.1 from all100krc;",
+                         'floatpostprocess' => 1,
+                         'delimiter' => '	',
+                    },{
+                        'num' => 4,
+                         'sql' => q\
+drop table if exists hive_write_4;
+create table hive_write_4 (name string, age int, gpa double) stored as sequencefile;
+insert into TABLE hive_write_4 select name, age, 1.1 from studenttab10k;\,
+                         'result_table' => 'hive_write_4',
+                         'verify_sql' =>"select name, age, 1.1 from studenttab10k;",
                          'floatpostprocess' => 1,
                          'delimiter' => '	',
                     } ]

Modified: incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/pig.conf
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/pig.conf?rev=1301811&r1=1301810&r2=1301811&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/pig.conf (original)
+++ incubator/hcatalog/trunk/src/test/e2e/hcatalog/tests/pig.conf Fri Mar 16 22:48:44 2012
@@ -154,6 +154,34 @@ store b into ':OUTPATH:';\,
 				,'sql' => q\select name, age from all100krc;\
                                 ,'floatpostprocess' => 1
                                 ,'delimiter' => '	'
+                                },
+                                {
+                                 # A table with one partition in text and one in rc
+                                 'num' => 4
+                                ,'hcat_prep'=>q?drop table if exists pig_read_4;
+create table pig_read_4 (name string, age int, gpa double) partitioned by (b string) row format delimited fields terminated by '\t' stored as textfile;
+alter table pig_read_4 add partition (b='1') location '/user/hcat/tests/data/studenttab10k';
+alter table pig_read_4 set fileformat rcfile;
+alter table pig_read_4 add partition (b='2') location '/user/hcat/tests/data/all100krc';?
+                                ,'pig' => q\a = load 'pig_read_4' using org.apache.hcatalog.pig.HCatLoader();
+b = foreach a generate name, age, b;
+store b into ':OUTPATH:';\,
+				,'sql' => q\(select name, age, 1 from studenttab10k)
+                            union all
+                            (select name, age, 2 from all100krc);\
+                                },
+                                {
+                                 # Read from a table in the non-default database
+                                 'num' => 5
+                                ,'hcat_prep'=>q?create database if not exists pig_db_1;
+drop table if exists pig_db_1.pig_read_5;
+create table pig_db_1.pig_read_5 (name string, age int, gpa double) partitioned by (b string) row format delimited fields terminated by '\t' stored as textfile;
+use pig_db_1;
+alter table pig_read_5 add partition (b='1') location '/user/hcat/tests/data/studenttab10k';?
+                                ,'pig' => q\a = load 'pig_db_1.pig_read_5' using org.apache.hcatalog.pig.HCatLoader();
+b = foreach a generate name, age, b;
+store b into ':OUTPATH:';\,
+				,'sql' => q\select name, age, 1 from studenttab10k;\
                                 }
                         ],
                 }, # end g
@@ -208,10 +236,82 @@ store b into 'pig_write_3' using org.apa
                                 ,'result_table' => 'pig_write_3'
                                 ,'floatpostprocess' => 1
                                 ,'delimiter' => '	'
+                                },
+                                {
+                                 # Store in a sequence file
+                                 'num' => 4
+                                ,'hcat_prep'=>q\drop table if exists pig_write_4;
+create table pig_write_4(
+            name string,
+            age int,
+            gpa double)
+stored as sequencefile;
+\
+                                ,'pig' => q\a = load 'studenttab10k' using org.apache.hcatalog.pig.HCatLoader();
+b = foreach a generate name, age, 0.1;
+c = foreach b generate name, age, $2 as gpa;
+store c into 'pig_write_4' using org.apache.hcatalog.pig.HCatStorer();\,
+				,'sql' => q\select name, age, 0.1 from studenttab10k;\
+                                ,'result_table' => 'pig_write_4'
+                                ,'floatpostprocess' => 1
+                                ,'delimiter' => '	'
+                                },
+                                {
+                                 # Write to a table in the non-default database
+                                 'num' => 5
+                                ,'hcat_prep'=>q?create database if not exists pig_db_1;
+create table if not exists pig_db_1.pig_write_5 (name string, age int) row format delimited fields terminated by '\t' stored as textfile;?
+                                ,'pig' => q\a = load 'studenttab10k' using org.apache.hcatalog.pig.HCatLoader();
+b = foreach a generate name, age;
+store b into 'pig_db_1.pig_write_5' using org.apache.hcatalog.pig.HCatStorer();\,
+				                ,'sql' => q\select name, age from studenttab10k;\
+                                ,'result_table' => 'pig_db_1.pig_write_5'
                                 }
                         ],
                 }, # end g
                 {
+                        'name' => 'Pig_Change_Schema',
+                        'tests' => [
+                            {
+                                 # I don't like this, I'm using one test to setup for the next.  But I don't know how else to do this.
+                                 'num' => 1
+                                ,'hcat_prep'=>q\drop table if exists pig_change_schema_1;
+create table pig_change_schema_1 (name string) partitioned by (ds string) STORED AS TEXTFILE;\
+                                ,'pig' => q\a = load 'studentparttab30k' using org.apache.hcatalog.pig.HCatLoader();
+b = filter a by ds == '20110924';
+c = foreach b generate name;
+store c into 'pig_change_schema_1' using org.apache.hcatalog.pig.HCatStorer('ds=20110924');\,
+                                ,'result_table' => 'pig_change_schema_1'
+				,'sql' => q\select name, ds from studentparttab30k where ds='20110924';\
+                                },
+                                {
+                                 # I don't like this, I'm using one test to setup for the next.  But I don't know how else to do this.
+                                 'num' => 2
+                                ,'depends_on' => 'Pig_Change_Schema_1'
+                                ,'hcat_prep'=>q\alter table pig_change_schema_1 add columns (age int);\
+                                ,'pig' => q\a = load 'studentparttab30k' using org.apache.hcatalog.pig.HCatLoader();
+b = filter a by ds == '20110925';
+c = foreach b generate name, age;
+store c into 'pig_change_schema_1' using org.apache.hcatalog.pig.HCatStorer('ds=20110925');\,
+                                ,'result_table' => 'pig_change_schema_1'
+				                ,'sql' => q\(select name, '', ds from studentparttab30k where ds='20110924')
+                                            union all
+				                            (select name, age, ds from studentparttab30k where ds = '20110925');\
+                                },
+                                {
+                                 # I don't like this, I'm using one test to setup for the next.  But I don't know how else to do this.
+                                 'num' => 3
+                                , 'depends_on' => 'Pig_Change_Schema_2'
+                                ,'pig' => q\a = load 'pig_change_schema_1' using org.apache.hcatalog.pig.HCatLoader();
+c = foreach a generate name, age, ds;
+store c into ':OUTPATH:';\
+				                ,'sql' => q\(select name, '', ds from studentparttab30k where ds='20110924')
+                                            union all
+				                            (select name, age, ds from studentparttab30k where ds = '20110925');\
+                                }
+                        ],
+                },
+                {
                         'name' => 'Pig_HBase',
                         'tests' => [
                                 {