presto

Presto SQL - How can i get all possible combination of an array?

↘锁芯ラ 提交于 2021-01-22 09:25:54
问题 I want all the possible combination of a number in a given set of array. I tried using some of the predefined functions of presto like array_agg(x) Input : [1,2,3,4] Output when n=2 : [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] when n=3 : [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] when n=4 : [[1,2,3,4]] or [1,2,3,4] 回答1: There is combinations(array(T), n) function and it does exactly what you want: select combinations(array[1,2,3,4],2); 来源: https://stackoverflow.com/questions/56540393/presto-sql-how-can-i

Presto SQL - How can i get all possible combination of an array?

℡╲_俬逩灬. 提交于 2021-01-22 09:25:47
问题 I want all the possible combination of a number in a given set of array. I tried using some of the predefined functions of presto like array_agg(x) Input : [1,2,3,4] Output when n=2 : [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] when n=3 : [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] when n=4 : [[1,2,3,4]] or [1,2,3,4] 回答1: There is combinations(array(T), n) function and it does exactly what you want: select combinations(array[1,2,3,4],2); 来源: https://stackoverflow.com/questions/56540393/presto-sql-how-can-i

数禾云上数据湖最佳实践

吃可爱长大的小学妹 提交于 2021-01-21 16:43:59
目录 1. 数禾科技 2. 云上自建CDH 3. 云上混合架构 4. 阿里云第一代数据湖 4.1. 什么是数据湖 4.2. 阿里云数据湖设计 4.2.1. 阿里云数据湖整体架构 4.2.2. 统一存储和元数据管理 4.2.3. 多EMR多OSS桶设计 4.2.4. 分布式调度系统设计 4.2.5. 用户权限系统设计 4.2.6. EMR弹性伸缩设计 4.2.7. 负载均衡管理 4.2.8. OSS桶生命周期管理 4.2.9. 日志管理 4.2.10. 终端权限管理 4.2.11. 组件UI管理 4.2.12. 监控告警管理 4.2.13. 即席查询设计 4.2.14. 集群安全组设计 4.2.15. 数据脱敏设计 4.2.16. YARN队列设计 4.3. 数据湖EMR治理 4.3.1. 调整EMR预伸缩时间 4.3.2. 更改EMR弹性伸缩策略 4.3.3. 优化EMR云盘空间 4.3.4. EMR机器组的选择 4.3.5. EMR成本控制 4.3.6. 购买RI预留抵扣券 4.3.7. 弹性保障 4.4. 数据湖OSS治理 4.4.1. 数仓ODS多版本桶治理 4.4.2. 数仓日志桶治理 4.4.3. 数仓桶和集市桶治理 4.4.4. 监控桶内对象 5. 阿里云第二代数据湖 5.1. 阿里云数据湖构建 5.2. 阿里云数据湖解决方案 1.数禾科技 数禾科技成立于2015年8月

阿里云 EMR Delta Lake 在流利说数据接入中的架构和实践

风格不统一 提交于 2021-01-21 12:45:23
简介: 为了消灭数据孤岛,企业往往会把各个组织的数据都接入到数据湖以提供统一的查询或分析。本文将介绍流利说当前数据接入的整个过程,期间遇到的挑战,以及delta在数据接入中产生的价值。 背景 流利说目前的离线计算任务中,大部分数据源都是来自于业务 DB,业务DB数据接入的准确性、稳定性和及时性,决定着下游整个离线计算 pipeline 的准确性和及时性。同时,我们还有部分业务需求,需要对 DB 中的数据和 hive 中的数据做近实时的联合查询。 在引入阿里云 EMR Delta Lake 之前,我们通过封装 DataX 来完成业务 DB 数据的接入,采用 Master-Slave 架构,Master 维护着每日要执行的 DataX 任务的元数据信息,Worker 节点通过不断的以抢占的方式获取状态为 init 和 restryable 的 DataX 任务来执行,直到当天的所有的 DataX 任务全都执行完毕为止。 架构图大致如下: Worker 处理的过程如下: 对于近实时需求,我们是直接开一个从库,配置 presto connector 去连接从库,来实现业务 BD 中的数据和 hive 中的数据做近实时的联合查询需求。 这种架构方案的优点是简单,易于实现。但是随着数据量也来越多,缺点也就逐渐暴露出来了: 性能瓶颈: 随着业务的增长,这种通过 SELECT

Recap | TGIP-001: Pulsar Basics

♀尐吖头ヾ 提交于 2021-01-15 06:55:08
🎙️阅读本文需 8 分钟 上周日(2 月 9 日),Pulsar 开启了 2020 年度第一次直播,也是小 Pu 成长路上的第一次线上直播,我们在 zoom 和 B 站同时进行了直播,也有很多朋友发弹幕和留言给我们,感谢各位的捧场! Pulsar 的第一场线上直播,请来了 StreamNative 的 CEO 郭斯杰大佬,为我们带来了一场关于 「Pulsar Basics」 的分享。 在正式进入内容前,郭斯杰也为大家介绍了什么是 TGIP (Thank God It's Pulsar), 类似可以参考 👇🏻Thank God It's Friday。 https://en.wikipedia.org/wiki/Thank_God_It%27s_Friday 同时更新了 Pulsar 的近况,主要是以下两个: Namespace level offloader https://github.com/apache/pulsar/pull/6183 Supports evenly distribute topics count when splits bundle https://github.com/apache/pulsar/pull/6241 后续大家还想了解关于 Pulsar 的任何问题,都可以去下边这个 repo 下提 issue,没准哪天你的提问就扩展为一期专门的直播啦! 🙋

判断是PC端还是移动端

為{幸葍}努か 提交于 2021-01-13 05:47:01
var browser= { versions:function(){ var u = navigator.userAgent, app = navigator.appVersion; return { // 移动终端浏览器版本信息 trident: u.indexOf( ' Trident ' ) > - 1 , // IE内核 presto: u.indexOf( ' Presto ' ) > - 1 , // opera内核 webKit: u.indexOf( ' AppleWebKit ' ) > - 1 , // 苹果、谷歌内核 gecko: u.indexOf( ' Gecko ' ) > - 1 && u.indexOf( ' KHTML ' ) == - 1 , // 火狐内核 mobile: !!u.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端 ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端 android: u.indexOf( ' Android ' ) > - 1 || u.indexOf( ' Linux ' ) > - 1 , // android终端或者uc浏览器 iPhone: u.indexOf( ' iPhone ' ) > - 1 ,

Athena/Presto - UNNEST MAP to columns

狂风中的少年 提交于 2020-12-26 12:26:28
问题 Assume i have a table like this, table: qa_list id | question_id | question | answer | ---------+--------------+------------+------------- 1 | 100 | question1 | answer | 2 | 101 | question2 | answer | 3 | 102 | question3 | answer | 4 | ... ... | ... and a query that gives below result (since I couldn't find a direct way to transpose the table), table: qa_map id | qa_map --------+--------- 1 | {question1=answer,question2=answer,question3=answer, ....} Where qa_map is the result of a map_agg of

Athena/Presto - UNNEST MAP to columns

前提是你 提交于 2020-12-26 12:19:15
问题 Assume i have a table like this, table: qa_list id | question_id | question | answer | ---------+--------------+------------+------------- 1 | 100 | question1 | answer | 2 | 101 | question2 | answer | 3 | 102 | question3 | answer | 4 | ... ... | ... and a query that gives below result (since I couldn't find a direct way to transpose the table), table: qa_map id | qa_map --------+--------- 1 | {question1=answer,question2=answer,question3=answer, ....} Where qa_map is the result of a map_agg of

Any Open source Presto ODBC driver?

痴心易碎 提交于 2020-12-13 03:28:19
问题 I'm looking for any open source Presto ODBC connector to connect AWS EMR Presto to Power BI desktop. Apart from Simba driver(magnitude) do we have any other ODBC driver that is open source. Appreciate your help! I have came through Teradata presto odbc driver but not sure whether it ll only support TD version of presto. Any insights on this will be great. 回答1: There is no open source, maintained ODBC driver for Presto that I know about. "Teradata presto odbc driver" is something that Teradata

基于云原生的大数据实时分析方案实践

拜拜、爱过 提交于 2020-12-03 14:31:51
1 方案介绍 大数据处理技术现今已广泛应用于各个行业,为业务解决海量存储和海量分析的需求。但数据量的爆发式增长,对数据处理能力提出了更大的挑战,同时对时效性也提出了更高的要求。实时分析已成为企业大数据分析中最关键的术语,这意味企业可将所有数据用于大数据实时分析,实现在数据接受同时即刻为企业生成分析报告,从而在第一时间作出市场判断与决策。典型的场景如电商大促和金融风控等,基于延迟数据的分析结果已经失去了价值。另外随着云原生时代的到来,云原生天生具有的高效部署、敏捷迭代、云计算资源成本和弹性扩展等优势,正在加速和缩短业务系统落地过程。云原生同样可助力大数据这一过程。 本文主要介绍如何利用 Kubernetes 实现云原生大数据实时分析平台。 2 总体架构 Data Streams:基于 Kafka 的数据流接入方案 Data Computations:基于 Spark Streaming 与 Flink 的流计算方案 Data Pipeline:基于 TKDF(Tencent Kubernetes Data Flow) 的数据工作流方案 Data Store:基于 Iceberg 与 HDFS 的数据湖方案 Data Interactive Analysis:基于 Spark SQL 与 Presto 的 SQL 交互式分析方案 Data Intelligence:基于