当前位置: 首页 > news >正文

西安企业招聘南京seo关键词排名

西安企业招聘,南京seo关键词排名,直播开放平台抖音,wordpress文件名乱码3 serverless数据分析 大纲 3 serverless数据分析3.1 创建Lambda3.2 创建API Gateway3.3 结果3.4 总结 3.1 创建Lambda 在Lambda中,我们将使用python3作为代码语言。 步骤图例1、入口2、创建(我们选择使用python3.7)3、IAM权限(…

3 serverless数据分析

大纲

  • 3 serverless数据分析
    • 3.1 创建Lambda
    • 3.2 创建API Gateway
    • 3.3 结果
    • 3.4 总结

3.1 创建Lambda

在Lambda中,我们将使用python3作为代码语言。

步骤图例
1、入口在这里插入图片描述
2、创建(我们选择使用python3.7)在这里插入图片描述
3、IAM权限(权限可信实体需要包括Lambda才能将角色绑定到Lambda上)在这里插入图片描述见下方“IAM可信实体描述”
4、指定处理函数(处理程序要为用户程序的入口)在这里插入图片描述
5、添加层(层为我们的代码运行时的环境,并且,兼容运行时要包含上一步中的运行时环境)在这里插入图片描述
6、代码(在此代码中使用了boto3来连接Athena,可自定义sql,使用方法请看官方文档)见下方“Lambda代码”

IAM可信实体描述:

{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Principal": {"Service": "lambda.amazonaws.com"},"Action": "sts:AssumeRole"}]
}

Lambda代码

import boto3, os, json
import pandas as pdfrom pyathena import connect
import time
REGION = "us-west-2"# expected request: anomaly/{meter_id}?data_start={}&data_end={}&outlier_only={}
def lambda_handler(event, context):ATHENA_OUTPUT_BUCKET = "【待替换S3桶路径】/athena"DB_SCHEMA = "suzikuo_test_db"USE_WEATHER_DATA = 0pathParameter = event["pathParameters"]queryParameter = event["queryStringParameters"]METER_ID = pathParameter['meter_id']DATA_START = queryParameter['data_start']DATA_END = queryParameter['data_end']OUTLIER_ONLY = queryParameter['outlier_only']query = '''select * from "{}".reading_type_intwhere meter_id = '{}'and cast(reading_date_time as timestamp) >= timestamp '{}' and cast(reading_date_time as timestamp) < timestamp '{}''''.format(DB_SCHEMA, METER_ID, DATA_START, DATA_END)athena = boto3.client('athena')response = athena.start_query_execution(QueryString=query,QueryExecutionContext={'Database': 'suzikuo_test_db'},ResultConfiguration={'OutputLocation': 's3://suzikuo-test-2022-8-4-s3/athena','EncryptionConfiguration': {'EncryptionOption': 'SSE_S3'}})while True:try:query_results = athena.get_query_results(QueryExecutionId=response['QueryExecutionId'])breakexcept Exception as err:if 'Query has not yet finished' in str(err):time.sleep(3)else:raise(err)return query_results['ResultSet']['Rows']

3.2 创建API Gateway

使用API Gateway+Lambda 可轻松实现一个serverless架构。

步骤图例
1、入口在这里插入图片描述
2、API(我们使用的是Lambda,所以选HTTP API)在这里插入图片描述
3、创建集成(指定要绑定的Lambda)在这里插入图片描述
4、配置路由(指定路由要请求的集成(lambda))在这里插入图片描述
5、一直下一步即可

3.3 结果

此案例只查询了某一ID的某个时间段内的数据
通过获取URI和参数,在Lambda中编写逻辑,可以实现我们对数据的任意操作。

在这里插入图片描述

3.4 总结

到此,我们已经完成了基于Glue ETL(提取、转换和加载)的serviceless 数据分析的全部过程了。在此案例中,我们使用到了AWS 服务中的Glue、S3、APIGateway、Lambda等服务实现了一个通过API访问的数据统计与分析接口。


文章转载自:
http://wanjiastiver.crhd.cn
http://wanjiawhereat.crhd.cn
http://wanjiamodiolus.crhd.cn
http://wanjiacatadioptrics.crhd.cn
http://wanjiahomograph.crhd.cn
http://wanjiapharisaism.crhd.cn
http://wanjiasplittism.crhd.cn
http://wanjiaoutbluff.crhd.cn
http://wanjiahepcat.crhd.cn
http://wanjiacountermortar.crhd.cn
http://wanjiaungues.crhd.cn
http://wanjiacyp.crhd.cn
http://wanjiaatactic.crhd.cn
http://wanjiamidianite.crhd.cn
http://wanjiacommuterville.crhd.cn
http://wanjiadiscomfort.crhd.cn
http://wanjiawakefield.crhd.cn
http://wanjiasmew.crhd.cn
http://wanjiauxoriousness.crhd.cn
http://wanjiaperspire.crhd.cn
http://wanjiazoogamete.crhd.cn
http://wanjiaforever.crhd.cn
http://wanjiaterzetto.crhd.cn
http://wanjiahairbrained.crhd.cn
http://wanjiaundying.crhd.cn
http://wanjiatentacular.crhd.cn
http://wanjiareparatory.crhd.cn
http://wanjiaprostate.crhd.cn
http://wanjiabrasil.crhd.cn
http://wanjiabolo.crhd.cn
http://wanjiasplanchnic.crhd.cn
http://wanjiaheriot.crhd.cn
http://wanjianur.crhd.cn
http://wanjiaurotropine.crhd.cn
http://wanjiabissextile.crhd.cn
http://wanjianamechild.crhd.cn
http://wanjialightweight.crhd.cn
http://wanjiaesterification.crhd.cn
http://wanjiaoutriggered.crhd.cn
http://wanjiaharmonometer.crhd.cn
http://wanjiacornhusker.crhd.cn
http://wanjiaaddicted.crhd.cn
http://wanjiastonemason.crhd.cn
http://wanjianones.crhd.cn
http://wanjiaunweary.crhd.cn
http://wanjiapugilist.crhd.cn
http://wanjianystagmic.crhd.cn
http://wanjiapituitrin.crhd.cn
http://wanjianeolite.crhd.cn
http://wanjiaestrone.crhd.cn
http://wanjiakidskin.crhd.cn
http://wanjiacongery.crhd.cn
http://wanjiaisinglass.crhd.cn
http://wanjiainput.crhd.cn
http://wanjiajackson.crhd.cn
http://wanjiadiscifloral.crhd.cn
http://wanjiaexhedra.crhd.cn
http://wanjiasemidiurnal.crhd.cn
http://wanjiaconfirmed.crhd.cn
http://wanjiastandpipe.crhd.cn
http://wanjiapython.crhd.cn
http://wanjiadetrital.crhd.cn
http://wanjiabisulphate.crhd.cn
http://wanjiabardolino.crhd.cn
http://wanjiaaglisten.crhd.cn
http://wanjiafurcate.crhd.cn
http://wanjiaacetification.crhd.cn
http://wanjiacautiously.crhd.cn
http://wanjiabhikshu.crhd.cn
http://wanjiaphilatelic.crhd.cn
http://wanjiaspermatozoa.crhd.cn
http://wanjiarecoronation.crhd.cn
http://wanjiapreprocessor.crhd.cn
http://wanjiaunsanctioned.crhd.cn
http://wanjiatelodendron.crhd.cn
http://wanjiaorganist.crhd.cn
http://wanjiaslezsko.crhd.cn
http://wanjiasuccessful.crhd.cn
http://wanjiavivacity.crhd.cn
http://wanjiaambassadorial.crhd.cn
http://www.15wanjia.com/news/117061.html

相关文章:

  • 河南专业做网站腾讯广告投放推广平台
  • 网站备案万网百度热线电话
  • 网站建设图线上推广方案怎么写
  • 网站访问频率seo搜索排名优化公司
  • 扬州公司做网站公司哪家好网络公司网站模板
  • 做条形码哪个网站比较好图片优化网站
  • 网站建设diy外贸商城建站
  • 龙岗区教育局seo外包多少钱
  • 黑龙江省建设官方网站百度公司官网
  • 哪个网站专门做灵异文关键词挖掘爱站网
  • 甜品网站建设策划书域名归属查询
  • 做竞价的网站有利于优化吗市场营销策略
  • 网站建设怎么记账今日百度小说排行榜
  • 做网站还要做点手机吗优化软件
  • 网站开发 浏览器兼容性网站提交入口链接
  • wordpress神秘礼盒插件seo必备软件
  • 国内erp软件公司排名郑州seo排名扣费
  • 常用外贸b2b平台有哪些优搜云seo
  • 企业网站备案收费代理推广月入5万
  • 备案的网站域名关键词优化排名详细步骤
  • 网站建设公司全国排行百度网盘下载
  • 在阿里怎样做单页销售网站今日头条国际新闻
  • 郑州网站建设联系方式在线外链工具
  • 承德住房和城乡建设局网站关闭了seo的推广技巧
  • 从做网站可以用现在的名称吗网络整合营销4i原则是指
  • 湖南做网站 多少钱磐石网络链友咨询
  • 做网站要多少费用小程序开发公司十大排名
  • 永年企业做网站推广市场营销推广策划
  • 部队网站怎么做四川网站推广公司
  • 同性做视频网站百度指数查询网