上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 49 下一页
摘要: 一.方法一 def update_data_batch(self,actions): """ 批量更新数据 :param actions: :return: """ item_list=[] for data in actions: dic = { "_index": self.index, "_t 阅读全文
posted @ 2020-06-29 23:37 阿布_alone 阅读(7777) 评论(0) 推荐(0) 编辑
摘要: 一.联集合查询(mysql的跨表查询) 要主要搞清楚那个是主集合,哪个是被查集合 db.主集合.aggregate([ {$lookup: { from: "被查集合", localField: "主集合字段名", foreignField: "被查集合字段名", as: "保存查询的结果字段名” 阅读全文
posted @ 2020-06-24 22:48 阿布_alone 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 一.分组操作 关键字$group 1.和distinct去重的比较 db.getCollection("2020062401").distinct('姓名') 返回的是一个列表 使用¥group分组 db.getCollection("2020062401").aggregate([ { $grou 阅读全文
posted @ 2020-06-24 20:32 阿布_alone 阅读(2802) 评论(0) 推荐(0) 编辑
摘要: 一.聚合查询就是流式的对数据处理,分成各个阶段 1.当聚合查询只有一个阶段就和find没有差别,如: 如果聚合有至少一个阶段, 那么每一个阶段都是一个字典。 不同的阶段负责不同的事情, 每一个阶段有一个关键字。 有专门负责筛选数据的阶段“$match”, 有专门负责字段相关的阶段“$project” 阅读全文
posted @ 2020-06-24 19:50 阿布_alone 阅读(726) 评论(0) 推荐(0) 编辑
摘要: 一.嵌入式文档的查询 { "_id": 1, "user": { "name": "zhangsan", "user_id": 1, "age": 18 } } 直接用点取值就可以: db.getCollection('test').find({'user.age':{$gt:18}},{'_id' 阅读全文
posted @ 2020-06-24 00:18 阿布_alone 阅读(1444) 评论(0) 推荐(0) 编辑
摘要: 步骤 1. scp -P xxxx user@xx.xx.xx.xx:aaa.txt . 2.输入密码 3.ctrl+z 暂停当前进程 4.bg(继续当前进程并切换到后台运行) 阅读全文
posted @ 2020-06-18 23:43 阿布_alone 阅读(865) 评论(0) 推荐(0) 编辑
摘要: 1、数据集下载 https://grouplens.org/datasets/movielens 参考地址 2、数据集下文件格式u.user用户属性文件 包含user.id用户ID gender性别 occupation职业 ZIP code邮编等属性,每个属性之间用|分割 u.item电影元数据 阅读全文
posted @ 2020-06-14 23:25 阿布_alone 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 代码: import re import datetime from pyspark.sql import SparkSession from pyspark import SparkContext from elasticsearch import Elasticsearch spark=Spar 阅读全文
posted @ 2020-06-14 15:59 阿布_alone 阅读(852) 评论(0) 推荐(0) 编辑
摘要: 一.为mapping增加字段,但是新增的字段之前数据已经写进索引了,所以,要从新索引 post 127.0.0.1/index/_mapping { "properties":{ "name":{ "type":"keyword" } } } 二.重新索引数据 POST 127.0.0.1/inde 阅读全文
posted @ 2020-06-10 23:52 阿布_alone 阅读(4996) 评论(0) 推荐(0) 编辑
摘要: 初尝 Python 3.7 引入了一个新的模块,这个模块就是今天要试探的 dataclass。dataclass 的用法和普通的类装饰器没有任何区别,它的作用是替换定义类的时候的:def __init__()我们来看看如何使用它 # 我们需要引入 dataclass 包 from dataclass 阅读全文
posted @ 2020-06-07 23:57 阿布_alone 阅读(1041) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 49 下一页
TOP