###Createdata## Cat/Dev/Urandom|Head-1 |Md5sum|Head-C8# # echo "$ (date+%s) "|Sha256sum|Base64|Head-C -; echo## Cat/Dev/Urandom|Awk'nr==1{print $0| " Md5sum|base64|grep-eo'^. { -}'"; exit}' forIinch{1..100000}do passwd=$ (Echo $RANDOM|Md5sum|Head-C8) echo "${i},${passwd}" done>/Tmp/Tmpa--CREATE TABLE UseXt_cfbdm_safe;Create TableTmpa (ID string,name string) ROW FORMAT delimited fields TERMINATED by ','stored astextfile;###CreateHqlfileCat>/Tmp/Tmpa.q<<'EOF' UseXt_cfbdm_safe;Select cast(ID%4 as int) asID,Count(1) asCNT,Count(distinctName asdiff,Count(distinctSUBSTR (Name,1,4)) asdiff2,Count(distinctSUBSTR (Name,1,3)) asDIFF3,Count(distinctSUBSTR (Name,1,2)) asDiff4,Count(distinctSUBSTR (Name,1,1)) asDiff5 fromTmpaGroup byId%4 Order byID; EOF--Load DataLoadData local Inpath'/tmp/tmpa'Overwrite into Tabletmpa;### Creating Thrift Server/Usr/Hdp/2.6.0.3-8/Spark/Sbin/Start-thriftserver.sh--Master yarn \--hiveconf hive.server2.thrift.bind.host=192.168.1.77 \--hiveconf hive.server2.thrift.port=14000# # Excute Jobbeeline-n Root-U jdbc:hive2://192.168.1.77:14000/Xt_cfbdm_safe-F/Tmp/Tmpa.q
Spark SQL Thrift Server