Saving all output to "!!{outputDirectory}!!/mapreduce5.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/mapreduce5.q >>> CREATE TABLE dest1(key INT, ten INT, one INT, value STRING) STORED AS TEXTFILE; No rows affected >>> >>> EXPLAIN FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key as c1, CAST(src.key / 10 AS INT) as c2, CAST(src.key % 10 AS INT) as c3, src.value as c4 DISTRIBUTE BY c4, c1 SORT BY c2 DESC, c3 ASC; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) key) c1) (TOK_SELEXPR (TOK_FUNCTION TOK_INT (/ (. (TOK_TABLE_OR_COL src) key) 10)) c2) (TOK_SELEXPR (TOK_FUNCTION TOK_INT (% (. (TOK_TABLE_OR_COL src) key) 10)) c3) (TOK_SELEXPR (. (TOK_TABLE_OR_COL src) value) c4)) (TOK_DISTRIBUTEBY (TOK_TABLE_OR_COL c4) (TOK_TABLE_OR_COL c1)) (TOK_SORTBY (TOK_TABSORTCOLNAMEDESC (TOK_TABLE_OR_COL c2)) (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL c3)))))' '' 'STAGE DEPENDENCIES:' ' Stage-1 is a root stage' ' Stage-0 depends on stages: Stage-1' ' Stage-2 depends on stages: Stage-0' '' 'STAGE PLANS:' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' src ' ' TableScan' ' alias: src' ' Select Operator' ' expressions:' ' expr: key' ' type: string' ' expr: UDFToInteger((key / 10))' ' type: int' ' expr: UDFToInteger((key % 10))' ' type: int' ' expr: value' ' type: string' ' outputColumnNames: _col0, _col1, _col2, _col3' ' Reduce Output Operator' ' key expressions:' ' expr: _col1' ' type: int' ' expr: _col2' ' type: int' ' sort order: -+' ' Map-reduce partition columns:' ' expr: _col3' ' type: string' ' expr: _col0' ' type: string' ' tag: -1' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: int' ' expr: _col2' ' type: int' ' expr: _col3' ' type: string' ' Reduce Operator Tree:' ' Extract' ' Select Operator' ' expressions:' ' expr: UDFToInteger(_col0)' ' type: int' ' expr: _col1' ' type: int' ' expr: _col2' ' type: int' ' expr: _col3' ' type: string' ' outputColumnNames: _col0, _col1, _col2, _col3' ' File Output Operator' ' compressed: false' ' GlobalTableId: 1' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: mapreduce5.dest1' '' ' Stage: Stage-0' ' Move Operator' ' tables:' ' replace: true' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: mapreduce5.dest1' '' ' Stage: Stage-2' ' Stats-Aggr Operator' '' '' 84 rows selected >>> >>> >>> FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key as c1, CAST(src.key / 10 AS INT) as c2, CAST(src.key % 10 AS INT) as c3, src.value as c4 DISTRIBUTE BY c4, c1 SORT BY c2 DESC, c3 ASC; '_col0','_col1','_col2','_col3' No rows selected >>> >>> SELECT dest1.* FROM dest1; 'key','ten','one','value' '490','49','0','val_490' '491','49','1','val_491' '492','49','2','val_492' '492','49','2','val_492' '493','49','3','val_493' '494','49','4','val_494' '495','49','5','val_495' '496','49','6','val_496' '497','49','7','val_497' '498','49','8','val_498' '498','49','8','val_498' '498','49','8','val_498' '480','48','0','val_480' '480','48','0','val_480' '480','48','0','val_480' '481','48','1','val_481' '482','48','2','val_482' '483','48','3','val_483' '484','48','4','val_484' '485','48','5','val_485' '487','48','7','val_487' '489','48','9','val_489' '489','48','9','val_489' '489','48','9','val_489' '489','48','9','val_489' '470','47','0','val_470' '472','47','2','val_472' '475','47','5','val_475' '477','47','7','val_477' '478','47','8','val_478' '478','47','8','val_478' '479','47','9','val_479' '460','46','0','val_460' '462','46','2','val_462' '462','46','2','val_462' '463','46','3','val_463' '463','46','3','val_463' '466','46','6','val_466' '466','46','6','val_466' '466','46','6','val_466' '467','46','7','val_467' '468','46','8','val_468' '468','46','8','val_468' '468','46','8','val_468' '468','46','8','val_468' '469','46','9','val_469' '469','46','9','val_469' '469','46','9','val_469' '469','46','9','val_469' '469','46','9','val_469' '452','45','2','val_452' '453','45','3','val_453' '454','45','4','val_454' '454','45','4','val_454' '454','45','4','val_454' '455','45','5','val_455' '457','45','7','val_457' '458','45','8','val_458' '458','45','8','val_458' '459','45','9','val_459' '459','45','9','val_459' '443','44','3','val_443' '444','44','4','val_444' '446','44','6','val_446' '448','44','8','val_448' '449','44','9','val_449' '430','43','0','val_430' '430','43','0','val_430' '430','43','0','val_430' '431','43','1','val_431' '431','43','1','val_431' '431','43','1','val_431' '432','43','2','val_432' '435','43','5','val_435' '436','43','6','val_436' '437','43','7','val_437' '438','43','8','val_438' '438','43','8','val_438' '438','43','8','val_438' '439','43','9','val_439' '439','43','9','val_439' '421','42','1','val_421' '424','42','4','val_424' '424','42','4','val_424' '427','42','7','val_427' '429','42','9','val_429' '429','42','9','val_429' '411','41','1','val_411' '413','41','3','val_413' '413','41','3','val_413' '414','41','4','val_414' '414','41','4','val_414' '417','41','7','val_417' '417','41','7','val_417' '417','41','7','val_417' '418','41','8','val_418' '419','41','9','val_419' '400','40','0','val_400' '401','40','1','val_401' '401','40','1','val_401' '401','40','1','val_401' '401','40','1','val_401' '401','40','1','val_401' '402','40','2','val_402' '403','40','3','val_403' '403','40','3','val_403' '403','40','3','val_403' '404','40','4','val_404' '404','40','4','val_404' '406','40','6','val_406' '406','40','6','val_406' '406','40','6','val_406' '406','40','6','val_406' '407','40','7','val_407' '409','40','9','val_409' '409','40','9','val_409' '409','40','9','val_409' '392','39','2','val_392' '393','39','3','val_393' '394','39','4','val_394' '395','39','5','val_395' '395','39','5','val_395' '396','39','6','val_396' '396','39','6','val_396' '396','39','6','val_396' '397','39','7','val_397' '397','39','7','val_397' '399','39','9','val_399' '399','39','9','val_399' '382','38','2','val_382' '382','38','2','val_382' '384','38','4','val_384' '384','38','4','val_384' '384','38','4','val_384' '386','38','6','val_386' '389','38','9','val_389' '373','37','3','val_373' '374','37','4','val_374' '375','37','5','val_375' '377','37','7','val_377' '378','37','8','val_378' '379','37','9','val_379' '360','36','0','val_360' '362','36','2','val_362' '364','36','4','val_364' '365','36','5','val_365' '366','36','6','val_366' '367','36','7','val_367' '367','36','7','val_367' '368','36','8','val_368' '369','36','9','val_369' '369','36','9','val_369' '369','36','9','val_369' '351','35','1','val_351' '353','35','3','val_353' '353','35','3','val_353' '356','35','6','val_356' '341','34','1','val_341' '342','34','2','val_342' '342','34','2','val_342' '344','34','4','val_344' '344','34','4','val_344' '345','34','5','val_345' '348','34','8','val_348' '348','34','8','val_348' '348','34','8','val_348' '348','34','8','val_348' '348','34','8','val_348' '331','33','1','val_331' '331','33','1','val_331' '332','33','2','val_332' '333','33','3','val_333' '333','33','3','val_333' '335','33','5','val_335' '336','33','6','val_336' '338','33','8','val_338' '339','33','9','val_339' '321','32','1','val_321' '321','32','1','val_321' '322','32','2','val_322' '322','32','2','val_322' '323','32','3','val_323' '325','32','5','val_325' '325','32','5','val_325' '327','32','7','val_327' '327','32','7','val_327' '327','32','7','val_327' '310','31','0','val_310' '311','31','1','val_311' '311','31','1','val_311' '311','31','1','val_311' '315','31','5','val_315' '316','31','6','val_316' '316','31','6','val_316' '316','31','6','val_316' '317','31','7','val_317' '317','31','7','val_317' '318','31','8','val_318' '318','31','8','val_318' '318','31','8','val_318' '302','30','2','val_302' '305','30','5','val_305' '306','30','6','val_306' '307','30','7','val_307' '307','30','7','val_307' '308','30','8','val_308' '309','30','9','val_309' '309','30','9','val_309' '291','29','1','val_291' '292','29','2','val_292' '296','29','6','val_296' '298','29','8','val_298' '298','29','8','val_298' '298','29','8','val_298' '280','28','0','val_280' '280','28','0','val_280' '281','28','1','val_281' '281','28','1','val_281' '282','28','2','val_282' '282','28','2','val_282' '283','28','3','val_283' '284','28','4','val_284' '285','28','5','val_285' '286','28','6','val_286' '287','28','7','val_287' '288','28','8','val_288' '288','28','8','val_288' '289','28','9','val_289' '272','27','2','val_272' '272','27','2','val_272' '273','27','3','val_273' '273','27','3','val_273' '273','27','3','val_273' '274','27','4','val_274' '275','27','5','val_275' '277','27','7','val_277' '277','27','7','val_277' '277','27','7','val_277' '277','27','7','val_277' '278','27','8','val_278' '278','27','8','val_278' '260','26','0','val_260' '262','26','2','val_262' '263','26','3','val_263' '265','26','5','val_265' '265','26','5','val_265' '266','26','6','val_266' '252','25','2','val_252' '255','25','5','val_255' '255','25','5','val_255' '256','25','6','val_256' '256','25','6','val_256' '257','25','7','val_257' '258','25','8','val_258' '241','24','1','val_241' '242','24','2','val_242' '242','24','2','val_242' '244','24','4','val_244' '247','24','7','val_247' '248','24','8','val_248' '249','24','9','val_249' '230','23','0','val_230' '230','23','0','val_230' '230','23','0','val_230' '230','23','0','val_230' '230','23','0','val_230' '233','23','3','val_233' '233','23','3','val_233' '235','23','5','val_235' '237','23','7','val_237' '237','23','7','val_237' '238','23','8','val_238' '238','23','8','val_238' '239','23','9','val_239' '239','23','9','val_239' '221','22','1','val_221' '221','22','1','val_221' '222','22','2','val_222' '223','22','3','val_223' '223','22','3','val_223' '224','22','4','val_224' '224','22','4','val_224' '226','22','6','val_226' '228','22','8','val_228' '229','22','9','val_229' '229','22','9','val_229' '213','21','3','val_213' '213','21','3','val_213' '214','21','4','val_214' '216','21','6','val_216' '216','21','6','val_216' '217','21','7','val_217' '217','21','7','val_217' '218','21','8','val_218' '219','21','9','val_219' '219','21','9','val_219' '200','20','0','val_200' '200','20','0','val_200' '201','20','1','val_201' '202','20','2','val_202' '203','20','3','val_203' '203','20','3','val_203' '205','20','5','val_205' '205','20','5','val_205' '207','20','7','val_207' '207','20','7','val_207' '208','20','8','val_208' '208','20','8','val_208' '208','20','8','val_208' '209','20','9','val_209' '209','20','9','val_209' '190','19','0','val_190' '191','19','1','val_191' '191','19','1','val_191' '192','19','2','val_192' '193','19','3','val_193' '193','19','3','val_193' '193','19','3','val_193' '194','19','4','val_194' '195','19','5','val_195' '195','19','5','val_195' '196','19','6','val_196' '197','19','7','val_197' '197','19','7','val_197' '199','19','9','val_199' '199','19','9','val_199' '199','19','9','val_199' '180','18','0','val_180' '181','18','1','val_181' '183','18','3','val_183' '186','18','6','val_186' '187','18','7','val_187' '187','18','7','val_187' '187','18','7','val_187' '189','18','9','val_189' '170','17','0','val_170' '172','17','2','val_172' '172','17','2','val_172' '174','17','4','val_174' '174','17','4','val_174' '175','17','5','val_175' '175','17','5','val_175' '176','17','6','val_176' '176','17','6','val_176' '177','17','7','val_177' '178','17','8','val_178' '179','17','9','val_179' '179','17','9','val_179' '160','16','0','val_160' '162','16','2','val_162' '163','16','3','val_163' '164','16','4','val_164' '164','16','4','val_164' '165','16','5','val_165' '165','16','5','val_165' '166','16','6','val_166' '167','16','7','val_167' '167','16','7','val_167' '167','16','7','val_167' '168','16','8','val_168' '169','16','9','val_169' '169','16','9','val_169' '169','16','9','val_169' '169','16','9','val_169' '150','15','0','val_150' '152','15','2','val_152' '152','15','2','val_152' '153','15','3','val_153' '155','15','5','val_155' '156','15','6','val_156' '157','15','7','val_157' '158','15','8','val_158' '143','14','3','val_143' '145','14','5','val_145' '146','14','6','val_146' '146','14','6','val_146' '149','14','9','val_149' '149','14','9','val_149' '131','13','1','val_131' '133','13','3','val_133' '134','13','4','val_134' '134','13','4','val_134' '136','13','6','val_136' '137','13','7','val_137' '137','13','7','val_137' '138','13','8','val_138' '138','13','8','val_138' '138','13','8','val_138' '138','13','8','val_138' '120','12','0','val_120' '120','12','0','val_120' '125','12','5','val_125' '125','12','5','val_125' '126','12','6','val_126' '128','12','8','val_128' '128','12','8','val_128' '128','12','8','val_128' '129','12','9','val_129' '129','12','9','val_129' '111','11','1','val_111' '113','11','3','val_113' '113','11','3','val_113' '114','11','4','val_114' '116','11','6','val_116' '118','11','8','val_118' '118','11','8','val_118' '119','11','9','val_119' '119','11','9','val_119' '119','11','9','val_119' '100','10','0','val_100' '100','10','0','val_100' '103','10','3','val_103' '103','10','3','val_103' '104','10','4','val_104' '104','10','4','val_104' '105','10','5','val_105' '90','9','0','val_90' '90','9','0','val_90' '90','9','0','val_90' '92','9','2','val_92' '95','9','5','val_95' '95','9','5','val_95' '96','9','6','val_96' '97','9','7','val_97' '97','9','7','val_97' '98','9','8','val_98' '98','9','8','val_98' '80','8','0','val_80' '82','8','2','val_82' '83','8','3','val_83' '83','8','3','val_83' '84','8','4','val_84' '84','8','4','val_84' '85','8','5','val_85' '86','8','6','val_86' '87','8','7','val_87' '70','7','0','val_70' '70','7','0','val_70' '70','7','0','val_70' '72','7','2','val_72' '72','7','2','val_72' '74','7','4','val_74' '76','7','6','val_76' '76','7','6','val_76' '77','7','7','val_77' '78','7','8','val_78' '64','6','4','val_64' '65','6','5','val_65' '66','6','6','val_66' '67','6','7','val_67' '67','6','7','val_67' '69','6','9','val_69' '51','5','1','val_51' '51','5','1','val_51' '53','5','3','val_53' '54','5','4','val_54' '57','5','7','val_57' '58','5','8','val_58' '58','5','8','val_58' '41','4','1','val_41' '42','4','2','val_42' '42','4','2','val_42' '43','4','3','val_43' '44','4','4','val_44' '47','4','7','val_47' '30','3','0','val_30' '33','3','3','val_33' '34','3','4','val_34' '35','3','5','val_35' '35','3','5','val_35' '35','3','5','val_35' '37','3','7','val_37' '37','3','7','val_37' '20','2','0','val_20' '24','2','4','val_24' '24','2','4','val_24' '26','2','6','val_26' '26','2','6','val_26' '27','2','7','val_27' '28','2','8','val_28' '10','1','0','val_10' '11','1','1','val_11' '12','1','2','val_12' '12','1','2','val_12' '15','1','5','val_15' '15','1','5','val_15' '17','1','7','val_17' '18','1','8','val_18' '18','1','8','val_18' '19','1','9','val_19' '0','0','0','val_0' '0','0','0','val_0' '0','0','0','val_0' '2','0','2','val_2' '4','0','4','val_4' '5','0','5','val_5' '5','0','5','val_5' '5','0','5','val_5' '8','0','8','val_8' '9','0','9','val_9' 500 rows selected >>> !record