五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網 會員登陸 & 注冊

hadoop

2023-06-14 14:41 作者:閉關修煉的庸人  | 我要投稿

?1.Hive分區(qū)創(chuàng)建表

Hive>create? table t_user_p(id int, name string)

Partitioned by (country string)

Row format delimited fields terminated by ‘,’;

2.mongoDB數據庫集合,文檔,查詢

(1)查看集合

from pymongo import MongoClient

class Test:

?????? def _ _init _ _(self):

?????????? self.client=MongoClient(’192.168.121.134’,27017)

??? ??? def getColl(self):

???????????? articledb = self.client[”articledb”]

???????????? collections=articledb.list_collection_names()

???????????? for collection in collections:

??????????????????? print(collection)

if _ _name _ _ ==’_ _main_ _’:

????????? test = Test()

?????????? test.getColl()

(2)創(chuàng)建集合

from pymongo import MongoClient

class Test:

?????? def _ _init _ _(self):

?????????? self.client=MongoClient(’192.168.121.134’,27017)

?????? def createColl(self):

???????????? articledb = self.client[”articledb”]

???????????? articledb.create_collection(”itcast”)

? if _ _name _ _ ==’_ _main_ _’:

??????? test = Test()

??????? test.createColl()

(3)刪除集合

from pymongo import MongoClient

class Test:

?????? def _ _init _ _(self):

?????????? self.client=MongoClient(’192.168.121.134’,27017)

?????? def dropColl(self):

??????????? articledb = self.client[”articledb”]

???????????? articledb.drop_collection(”itcast”)

? if _ _name _ _ ==’_ _main_ _’:

??????? test = Test()

??????? test.dropColl()

(3)查看文檔

from pymongo import MongoClient

class Test:

?????? def _ _init _ _(self):

?????????? self.client=MongoClient(’192.168.121.134’,27017)

?????? def findDoc(self):

??????????? self.articledb = self.client[”articledb”]

??????????? comment = self.articledb[”comment”]

?????????? documents = comment.find()

????????????????????????? for ?document in documents:

?????????????????? print( document)

? if _ _name _ _ ==’_ _main_ _’:

??????? test = Test()

??????? test.findDocl()

?


hadoop的評論 (共 條)

分享到微博請遵守國家法律
新建县| 石棉县| 垫江县| 泸州市| 万州区| 石棉县| 黄骅市| 湖北省| 中超| 榆林市| 海口市| 福安市| 鄢陵县| 灌南县| 濮阳县| 和顺县| 泽普县| 安乡县| 克什克腾旗| 二连浩特市| 北京市| 万宁市| 西藏| 钟祥市| 太仆寺旗| 宜兰县| 遂平县| 桃园县| 山西省| 遂溪县| 香港 | 班戈县| 麦盖提县| 宜都市| 宁强县| 铜陵市| 永清县| 卢氏县| 西林县| 潼关县| 安泽县|