- 組件架構(gòu):
hiveserver2(beeline),hive,metadb
Execution Engine – The component which executes the execution plan created by the compiler. The plan is a DAG of stages. The execution engine manages the dependencies between these different stages of the plan and executes these stages on the appropriate system components.
連接hiveserver2
GUI CLI JDBC (beeline)數(shù)據(jù)源
用kafka挫以,sqoop等獲得data叹哭,放入hdfs喊积,這些數(shù)據(jù)各種結(jié)構(gòu)都有蝗蛙。
關(guān)系數(shù)據(jù)庫(kù)的表著角,MongoDB 或json數(shù)據(jù)长已,或日志執(zhí)行hql
背后運(yùn)行的是mapreduce or Tez jobs(類似于pig latin腳本執(zhí)行pig)
insert into test values("wangyuq","123");
查看tracking urlstage
將你的數(shù)據(jù)移到目的位置之前,將會(huì)staing 那兒一段時(shí)間鸣驱。staging文件最終丟棄泛鸟。比對(duì)
pig是對(duì)非結(jié)構(gòu)化數(shù)據(jù)處理的好的etl。
hive不是關(guān)系數(shù)據(jù)庫(kù)踊东,只是維護(hù)存儲(chǔ)在HDFS的數(shù)據(jù)的metadata北滥,使得對(duì)大數(shù)據(jù)操作就像sql操作表一樣,只不過(guò)hql和sql稍有出入闸翅。使我們能用sql來(lái)執(zhí)行mr再芋。可以對(duì)hdfs數(shù)據(jù)進(jìn)行query坚冀。
hive使用metastore存表济赎。hive默認(rèn)derby但是可自定義更換。劣
hive不能承諾優(yōu)化,只是簡(jiǎn)單司训,因此hive不能支持實(shí)時(shí)构捡,性能差
index view有限制(partition bucket 彌補(bǔ))
和sql 的datatype不完全一樣與hdfs關(guān)系
hdfs里有hive,data在hdfs上壳猜,schema在metastore里勾徽。
load語(yǔ)句: 將hdfs搬運(yùn)到hive,hdfs不再有該數(shù)據(jù)蓖谢。只是將真正的data轉(zhuǎn)到了hive目錄下捂蕴。