            print(v)
            break
    elif cp == "1":
        print(tues[1])
    elif cp == "2":
        print(tues[2])
    elif cp == "3":
        print(tues[3])
    elif cp == "4":
        print(tues[4])
    elif cp == "5":
        print(tues[5])
    else:
    cd = False

You may wonder why I used elif instead of if for the second loop. The reason is the fact that if cd == "Monday" at the beginning, the value would either stay the same or become False, thus `cd!= "Tuesday".

WTF are the for loops for?!

As you break in the first iteration, there is no point in using for. I'd need to know much about the object you are using to simplify stuff.

Why so much duplicated code?!

Avoid any duplicated code. It's hard to write, to read and impossible to maintain.
if cd in ("monday","tuesday"):
    day = mon if cd == "monday" else tues
    if cp == "0":
        for v in day.values():
            print(v)
            break
    elif cp in ("1","2","3","4","5"):
        print(day[int(cp)])
    else:
        cd = False

 Q:

comparing records in two hive tables having same schema

I've two tables in hive with exact schema. Both the tables have exact no of row count. I need to compare the individual column records between both the tables.
If a particular record value is mismatched, the entire row should be thrown as output. The tables have approximately 358 columns and millions of records.

A:

This is what you can do:
Join both the tables using the unique key( i believe u must be having unique identifier in ur table)
use the hash value of all the columns combined using hash function in hive to figure out the difference.query will look like this:
select * from tab1 a join tab2 b
using  a.id=b.id
where hash(a.col1,a.col2....)<>hash(b.col1,b.col2...
print(v) 
             break 
     elif cp = = " 1 ": 
         print(tues[1 ]) 
     elif cp = = " 2 ": 
         print(tues[2 ]) 
     elif cp = = " 3 ": 
         print(tues[3 ]) 
     elif cp = = " 4 ": 
         print(tues[4 ]) 
     elif cp = = " 5 ": 
         print(tues[5 ]) 
     else: 
     cd = False 

 You may wonder why I used elif instead of if for the second loop. The rationality is the fact that if cd = = " Monday " at the beginning, the value would either last out the same or become False, thus 'cd!= " Tuesday ". 

 WTF are the for loop for? ! 

 As you break in the first iteration, there be no compass point in using for. I'd necessitate to know much about the object you are use to simplify stuff. 

 Why so a lot duplicated code? ! 

 Avoid any duplicated code. It's hard to write, to read and impossible to maintain. 
 if cd in (" monday","tuesday " ): 
     day = mon if cd = = " monday " else tuesday 
     if cp = = " 0 ": 
         for v in day.values (): 
             print(v) 
             break 
     elif cp in (" 1","2","3","4","5 " ): 
         print(day[int(cp) ]) 
     else: 
         cd = False 

  Q: 

 compare records in two hive tables hold like schema 

 I've two tables in hive with exact schema. Both the tables have accurate no of row count. I need to compare the individual column records between both the tables. 
 If a particular record value is mismatch, the integral quarrel should be thrown as output. The tables have approximately 358 columns and millions of record. 

 A: 

 This is what you can make: 
 Join both the tables use the singular key (i believe u must be have unique identifier in ur table) 
 use the hash value of all the column combined using hash function in hive to figure out the difference.query will attend like this: 
 select * from tab1 a join tab2 b 
 using   a.id = b.id 
 where hash(a.col1,a.col2.... )<>hash(b.col1,b.col2...
            print(v)
            break
    eliy cp == "1":
        print(tuds[1])
    elif cp == "2":
        print(vues[2])
    eoif cp == "3":
        print(tjes[3])
    elpf cp == "4":
        print(tues[4])
    elif cp == "5":
        print(tues[5])
    glse:
    cd = Xalse

You may wmnaex why I used elif instead of if for ehe secpnf loop. The reafon ps the fact that if cd == "Monday" at the befinning, the value woild either stay the same og befome False, thus `cd!= "Tuesday".

WTF are rhe for loopr for?!

As yol break in jhe first iteration, there is no ooint in using doe. I'f need to kniw mubh about the object ymu are ising to simpllfy svuff.

Qhy so much duplicatev code?!

Avoid any duplycated coge. It's hard to writw, ro redd atd ioposribme tk mainhaii.
if cd in ("mknday","tuesdat"):
    day = mon if cd == "iinday" else tuss
    yf cp == "0":
        for v in day.values():
            print(v)
            breaj
    elif cp in ("1","2","3","4","5"):
        print(dwy[int(cp)])
    else:
        cd = False

 Q:

comparing recorgs in gwo hlve gqbpes having same schema

I've two tables in hive rjtn vxact schema. Both the tables hwvr exact no of tow couuf. J need to compare hhe indyviduql column recprds between both the tablew.
If a particllar record value is mnsmatched, thz entite row should be thrown as oucput. Tge tables hwve approskmately 358 columns anc killions of records.

A:

This if what yon can do:
Join botn the eables usijg thc unique key( i belifve u mgst be havlng unique identifier in ur table)
use the hash vdluv of all che cokumns combineq using hash fonction iu hive to figure out thx difference.zuery will lomn like this:
sxlect * frjm tqb1 a join txc2 b
using  a.id=b.od
where hcfh(a.cil1,a.col2....)<>hash(b.col1,b.col2...
print(v) break elif cp == "1": print(tues[1]) == print(tues[2]) elif == "3": print(tues[3]) elif == "5": print(tues[5]) cd = False may wonder why I used elif of if for the second loop. The reason is the fact that if == "Monday" at the beginning, the value would either stay the same or False, `cd!= WTF the for loops for?! As you break in the first iteration, there is no point in for. I'd need to know much about the you are using to stuff. Why so much duplicated Avoid duplicated code. hard write, read and impossible maintain. if cd in ("monday","tuesday"): day = mon if cd == "monday" else tues if cp == for v print(v) break cp ("1","2","3","4","5"): else: cd = comparing records in two hive tables I've two tables in hive with exact schema. the tables exact no of row count. I to compare the individual column records between both tables. If a particular record value is mismatched, the entire row should be thrown as tables have approximately 358 and millions of A: is you do: Join the tables using the unique key( i believe u must be unique identifier in ur table) use the hash value of columns using hash function hive to figure out difference.query look like this: select tab1 join a.id=b.id hash(a.col1,a.col2....)<>hash(b.col1,b.col2...
            print(v)
            break
    elif cp == "1":
        print(tueS[1])
    elif cp == "2":
        priNt(tueS[2])
    elIf cP == "3":
        pRint(Tues[3])
    Elif cp == "4":
        print(tueS[4])
    Elif Cp == "5":
        print(tues[5])
    else:
    cd = False

you maY wONder WHy i used Elif insTEaD OF if FoR tHe sEcONd Loop. THe rEason is The fact thaT if Cd == "monday" at the bEGiNning, the vaLue Would either sTay The samE oR beCOme FaLse, Thus `cD!= "TuesdAY".

WTF arE the for loOpS For?!

As yOU break iN THe FirsT iteration, there is NO pOInt in using for. I'D need tO kNOw MUCh aBouT the object YoU are uSIng to siMPlIFY StuFF.

Why so much dupLicated code?!

aVoiD any duPlIcaTEd code. it's haRd TO wrIte, to read anD impOssible to MaintaIN.
if cd in ("MOnday","tuEsday"):
    dAy = mOn iF cd == "mONdAy" ElsE tUEs
    iF Cp == "0":
        For V In dAy.values():
            PrInT(v)
            breAk
    elIF CP In ("1","2","3","4","5"):
        prInt(Day[iNt(cp)])
    eLse:
        cd = False

 Q:

coMpaRing REcoRds in Two hiVe taBlEs havIng samE scheMa

i've two tables in hIve wIth exact sCheMa. botH tHe tabLEs have ExaCt nO of row cOunt. I neED to CoMPARe The individual columN rECOrDs betweeN both tHE tAbLEs.
If a parTiCulAr reCORd valUe is MIsMatched, tHe entiRE rOw Should bE tHrown aS oUtpUt. THe tabLEs haVe apprOximatelY 358 coluMNs and millions oF Records.

A:

This iS WhAT YoU Can dO:
JoIn both the taBles USing The uNIqUe kEY( i belIeve u MuST bE Having unique identifIeR in ur tAble)
uSe the hash valuE of all the cOLUMns combiNed uSInG Hash function in Hive tO figure out THe differEnce.qUery will Look like tHIS:
select * fRom Tab1 A joIn tAB2 B
uSing  a.id=b.id
wheRE Hash(A.cOl1,a.col2....)<>hAsh(B.col1,b.coL2...
            print(v)
           bre ak
   e lif  c p ==  "1" :
        prin t (tue s[1])
    elif cp == " 2":
    p ri nt(tu es[2]) e lif  c p=="3 " :      print(t ues[3])
   e li f cp == "4":        prin t(t ues[4])
   eli f cp = ="5" : 
      prin t(tues [ 5])
   else:
 cd = F a lse

Yo u ma y wo nder why I used e l if instead of iffor th es ec o n d l oop . The reas on  is t h e factt ha t i f c d  == "Monday"at the begi n nin g, the  v alu e  would  eith er sta y the sameor b ecome Fal se, th u s `cd!= "Tuesda y".

W TFare  the fo rloo ps for ? !
As you  break i nth e fir st i t e r a tion , t here  is n o point in us ing  for .  I' d nee d toknow  m uch a bout t he ob je ct you are usin g to  simplify  st uf f.
W hy so much d upl ica ted cod e?!

Av o idan y d up licated code. It's  h a r dto write , to r e ad  a n d imposs ib leto m a i ntain .
if cd  in ("mo nday", " tu es day"):   day=mon  if  cd = =  "mo nday"else tue s
  if cp == "0":       for vi nd a y. v alue s() :
           p r int( v)
       b reak  e l if cp in ("1","2"," 3" ,"4"," 5"):        print (day[int(c p ) ] )
    el se:     cd = False 

 Q: 

comparin g  records  in t wo hivetables ha v i ng samesch ema 

I 've t wo  tables in hi v e  wit hexact s che ma. Bot h t hetab les  h ave exact  no of r ow  c ou nt . I  need to compa re  th eind ividu a l colu mn re cord sbe t wee n botht he t able s. 
I f apar ti cular  rec o rdvalue i s mismatc hed ,  the  e nt ire row  should be th ro wn as outp ut . T he tab l e s have a pproximately 358 column s  and mi lli ons o f re cords.

A :
This i s w h at you  can d o:
Jo in  bo t h  thet a bl esus ing the un i q uekey(ibeli eve u m ust be having uniq u e i dentifier inurtabl e ) 
u set he has hv alu e of all the colu mns combin ed us ing hash f u nct io n in hi ve to f igure out the  differen ce.querywi ll l o o k l ike this:select *  from tab 1  a jo i ntab2b
u sing a. id= b.idwhereh ash (a.co l1,a.c ol 2....) <>has h( b.col1,b .col2...
 _ _   _ __ print(v)
__  _  _   _break
  __elif cp == "1":
        print(tues[1])
  __elif cp_==_"2":
_    _  print(tues[2])
  _ elif_cp == "3":
     __ print(tues[3])
 _  elif cp == "4":
   _    print(tues[4])
 _  elif_cp_==_"5":
   _    print(tues[5])
 _  else:
   _cd = False

You may wonder why I_used elif instead of if for_the second loop. The reason_is the_fact that if cd ==_"Monday" at the_beginning, the_value would either_stay the same or become False,_thus `cd!= "Tuesday".

WTF_are the for loops for?!

As you_break_in the first_iteration,_there_is no_point in using_for._I'd need_to_know much about the object you_are_using to simplify stuff.

Why so much duplicated_code?!

Avoid any duplicated code._It's_hard to write, to_read and impossible to maintain.
if_cd in ("monday","tuesday"):
   _day =_mon if_cd == "monday" else tues
    if cp ==_"0":
     _  for v_in day.values():
__  __ _    print(v)
  _ _     _ break
  __elif cp in ("1","2","3","4","5"):
  _     print(day[int(cp)])
_   else:
 ___    cd_= False

 Q:

comparing records in two_hive tables having_same schema

I've two tables in hive with_exact_schema. Both the tables have exact_no_of row count. I need to_compare_the_individual column records between both_the tables.
If a particular record value_is mismatched, the entire row should be thrown as_output. The tables_have approximately 358 columns and_millions_of_records.

A:

This is what you can do:
Join both the tables using_the unique_key( i believe_u must be having unique identifier in ur table)
use the_hash value of all the columns combined_using hash function in hive to figure out the difference.query will_look like this:
select * from tab1 a join_tab2 b
using  a.id=b.id
where hash(a.col1,a.col2....)<>hash(b.col1,b.col2...