五月天青色头像情侣网名,国产亚洲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的評論 (共 條)

分享到微博請遵守國家法律
竹山县| 常州市| 宿州市| 固原市| 鄯善县| 泰来县| 新昌县| 永泰县| 湛江市| 老河口市| 东方市| 六枝特区| 洪湖市| 开封市| 五华县| 高青县| 海城市| 聊城市| 新绛县| 腾冲县| 周口市| 北票市| 亚东县| 监利县| 越西县| 余姚市| 阿合奇县| 凤翔县| 嘉鱼县| 富阳市| 岳普湖县| 泸州市| 灵石县| 吉首市| 迁安市| 洪湖市| 崇阳县| 邵东县| 和田县| 临泽县| 辽阳县|