udf

如何跨项目工作空间访问MaxCompute资源和函数

你说的曾经没有我的故事 提交于 2020-01-07 03:51:50
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1、背景介绍 同一个主账号下面的两个工作空间,工作空间名称分别为 A工作空间名称:wei_wwww A工作空间子账号:mc_oss B工作空间名称:wei_mc B工作空间子账号:bigdata_wei 现在B工作空间子账号bigdata_wei需要访问A工作空间子账号mc_oss创建的UDF函数。执行查询语句报错信息如下: 2、MaxCompute项目空间支持的对象类型及操作 MaxCompute提供了ACL授权、跨项目空间数据分享、项目空间数据保护等多种策略。授权操作一般涉及到三个要素,即主体(Subject,可以是用户也可以是角色)、客体(Object)和操作(Action)。在MaxCompute中,主体是指用户或角色,客体是指项目空间中的各种类型对象。我们推荐您优先使用ACL(基于对象)授权,而非Policy(基于策略)授权。 ACL授权中,MaxCompute的客体包括项目空间、表、函数、资源、任务实例 授权方式: grant actions on object to subject; 3、授权 (1)在A工作空间创建一个函数 A工作空间名称:wei_wwww 创建角色: create role worker; 角色指派: grant worker TO ram$建伟MaxCompute:mc

Selecting multiple parameters from UDF or procedure

主宰稳场 提交于 2020-01-06 23:56:12
问题 I'm trying to compute multiple values and fetch them in a select clause. Whether its computed via UDF or procedure does not matter to me but I can't figure out how to do it in either way. I want to use it like this: SELECT ID, BITMAP(ID) FROM X; which then should return a table with columns ID, Bitset1, Bitset2 . If possible it should be as performant as possible. I have three versions currently (simplified, there's actual more computation): Table UDF CREATE FUNCTION TPCH.BITMAP(IN col BIGINT

美团点评基于 Flink 的实时数仓平台实践

时间秒杀一切 提交于 2020-01-06 23:27:50
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、美团点评实时计算演进 美团点评实时计算演进历程 在 2016 年,美团点评就已经基于 Storm 实时计算引擎实现了初步的平台化。2017 年初,我们引入了 Spark Streaming 用于特定场景的支持,主要是在数据同步场景方面的尝试。在 2017 年底,美团点评实时计算平台引入了 Flink。相比于 Storm 和 Spark Streaming,Flink 在很多方面都具有优势。这个阶段我们进行了深度的平台化,主要关注点是安全、稳定和易用。从 19 年开始,我们致力于建设包括实时数仓、机器学习等特定场景的解决方案来为业务提供更好的支持。 实时计算平台 目前,美团点评的实时计算平台日活跃作业数量为万级,高峰时作业处理的消息量达到每秒 1.5 亿条,而机器规模也已经达到了几千台,并且有几千位用户正在使用实时计算服务。 实时计算平台架构 如下图所示的是美团点评实时计算平台的架构。 最底层是 收集层 ,这一层负责收集用户的实时数据,包括 Binlog、后端服务日志以及 IoT 数据,经过日志收集团队和 DB 收集团队的处理,数据将会被收集到 Kafka 中。这些数据不只是参与实时计算,也会参与离线计算。 收集层之上是 存储层 ,这一层除了使用 Kafka 做消息通道之外,还会基于 HDFS

Using Hive UDF in Impala gives erroneous results in Impala 1.2.4

血红的双手。 提交于 2020-01-06 14:54:47
问题 I have two Hive UDFs in Java which work perfectly well in Hive. Both functions are complimentary to each other. String myUDF(BigInt) BigInt myUDFReverso(String) myUDF("myInput") gives some output which when myUDFReverso(myUDF("myInput")) should give back myInput This works in Hive but when I try to use it in Impala (version 1.2.4) it gives expected answer for myUDF(BigInt) (the answer printed is correct) but the answer when passed to myUDFReverso(String) doesn't give back original answer). I

Using Hive UDF in Impala gives erroneous results in Impala 1.2.4

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 14:54:05
问题 I have two Hive UDFs in Java which work perfectly well in Hive. Both functions are complimentary to each other. String myUDF(BigInt) BigInt myUDFReverso(String) myUDF("myInput") gives some output which when myUDFReverso(myUDF("myInput")) should give back myInput This works in Hive but when I try to use it in Impala (version 1.2.4) it gives expected answer for myUDF(BigInt) (the answer printed is correct) but the answer when passed to myUDFReverso(String) doesn't give back original answer). I

Match Any Word Inside Cell With Any Word In Range of Cells

北战南征 提交于 2020-01-04 14:06:55
问题 I have a list of phrases. I would like to check if any new terms match that list partially by word. I'm looking for a code to implement fuzzy matching on the list to return the cell that has a close match. Example Data: Phrases,Terms real term,new words great work,new term check phrase,more phrase example here,great alpha phrase random,beta new Desired Output: Phrases,Term,Match real term,new words,No match great work,new term,real term check phrase,more phrase,check phrase/phrase random

Use a UDF as the default value in a table column in SQL Server

独自空忆成欢 提交于 2019-12-31 01:47:54
问题 I created a scaler UDF (called sCurrentAppUser()) in SQL Server 2012 Express and I would like to use this UDF as a default value when defining a table. But every time I try, I get an error of "'sCurrentAppUser' is not a recognized built-in function name." Since I can't post more than two links yet (reputation), I'll link to my research and references in a comment. Here's my UDF: ALTER FUNCTION [dbo].[sCurrentAppUser] () RETURNS nVarChar(128) AS BEGIN DECLARE @CurrentAppUser nVarChar(128) IF

UDF for array formulas created from macro

≡放荡痞女 提交于 2019-12-25 08:31:18
问题 I want to create a udf for a formula I have written on excel. The formula is as follows: =INDEX('Pivot-LH'!$D$5:$D$1650,SMALL(IF(B93='Pivot-LH'!$A$5:'Pivot-LH'!$A$1650,ROW('Pivot-LH'!$A$5:'Pivot-LH'!$A$1650)-ROW('Pivot-LH'!$A$5)+2),1)) Basically the syntax is to look for cell B93 (variable) through some data on Pivot-LH sheet and return the 1st, 2nd and 3rd values. I want to define a udf for this and tried to do this by recording a macro. It gave the following result which I modified to enter

User defined function in VBA not “array-firendly”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 08:07:04
问题 I have the following user-defined functions created: Public Function LNt(LMiu As Double, LSigma As Double, t As Double) Application.Volatile LNt = Application.WorksheetFunction.NormDist(Log(t) / Log(2.71828182845905), LMiu, LSigma, False) / t End Function and Public Function IntLNt(LMiu As Double, LSigma As Double, Lower As Double, Upper As Double, Step As Integer) Application.Volatile Dim Delta As Double Dim I As Double Delta = ((Log(Upper) / Log(2.71828182845905)) - (Log(Lower) / Log(2

How do I compare each column in a table using DataFrame by Scala without caring what the column is? [duplicate]

橙三吉。 提交于 2019-12-24 19:19:09
问题 This question already has answers here : How do I compare each column in a table using DataFrame by Scala (2 answers) Closed 2 years ago . The question I asked before is as follows. Last question Table 1 -- ID pairs table Table 2 -- Attribute table Table 3 For example, id1 and id2 have different color and size, so the id1 and id2 row(2nd row in Table 3) has "id1 id2 0 0"; id1 and id3 have same color and different size, so the id1 and id3 row(3nd row in Table 3) has "id1 id3 1 0"; Same