user-defined-functions

Where does mysql save the path for gearman mysql udf files?

吃可爱长大的小学妹 提交于 2019-12-24 04:16:28
问题 I have been trying to use gearman mysql udf. I have downloaded tarball from http://gearman.org/index.php?id=download and installed it with the instructions given on http://gearman.org/index.php?id=mysql_udf_readme I am trying to create the gman_do function in mysql, but I am getting some error The Error is- mysql> create function gman_do returns string soname "libgearman_mysql_udf.so"; ERROR 1126 (HY000): Can't open shared library 'libgearman_mysql_udf.so' (errno: 22 /usr/local/lib/libgearman

ERROR Executor: Exception in task 0.0 in stage 6.0 spark scala?

蓝咒 提交于 2019-12-24 03:15:10
问题 I have a json file like below. {"name":"method2","name1":"test","parameter1":"C:/Users/test/Desktop/Online.csv","parameter2": 1.0} I am loading my json file. val sqlContext = new org.apache.spark.sql.SQLContext(sc) val df = sqlContext.read.json("C:/Users/test/Desktop/data.json") val df1=df.select($"name",$"parameter1",$"parameter2").toDF() df1.show() I have 3 function like below: def method1(P1:String, P2:Double) { val data = spark.read.option("header", true).csv(P1).toDF() val rs= data

Creating a table method on a user defined type (like like 'nodes' on the XML data type)

北城以北 提交于 2019-12-24 02:21:57
问题 I've created working SQLCLR-based user defined table-valued functions as well as user defined types. What I want now is a method on a SQLCLR UDT that returns a table, similar to the nodes method on the XML data type. The TableDefinition and FillRowMethodName properties of the SqlMethod attribute / decoration seem to imply that it should be possible, but nothing actually works. When I call the method like this (which I expect to fail): SELECT @Instance.AsTable(); I get: invalid data type which

How to convert into handling a 2D/3D array

喜夏-厌秋 提交于 2019-12-24 02:18:36
问题 I have an issue with a being able to pass a parameter into a fucntion to return a specific value and I was given the solution below by @ja72 I wanted to expanded it into accepting a 2d/3d array and he suggested I post it as a new question to find the solution. Can anyone help? The code below produces the following debug output 2 values defined. ThisWorkbook.Position(0) First Value ThisWorkbook.Position(1) Second Value It uses a private array in the workbook named m_position . The contents are

Can an Excel VBA UDF called from the worksheet ever be passed an instance of any Excel VBA object model class other than 'Range'?

若如初见. 提交于 2019-12-24 02:16:30
问题 I'm 99% sure that the answer is "no", but I'm wondering if someone who is 100% sure can say so. Consider a VBA UDF: Public Function f(x) End Function When you call this from the worksheet, 'x' will be a number, string, boolean, error, array, or object of type 'Range'. Can it ever be, say, an instance of 'Chart', 'ListObject', or any other Excel-VBA object model class? (The question arose from me moving to Excel 2007 and playing with Tables, and wondering if I could write UDFs that accept them

BigQuery : is it possible to execute another query inside an UDF?

泄露秘密 提交于 2019-12-24 00:42:59
问题 I have a table that records a row for each unique user per day with some aggregated stats for that user on that day, and I need to produce a report that tells me for each day, the no. of unique users in the last 30 days including that day. eg. for Aug 31st, it'll count the unique users from Aug 2nd to Aug 31st for Aug 30th, it'll count the unique users from Aug 1st to Aug 30th and so on... I've looked at some related questions but they aren't quite what I need - if a user logs in on multiple

How to modify the TTL of all records set with a ttl of -1 in aerospike?

浪尽此生 提交于 2019-12-23 22:03:06
问题 I want to modify the TTL of all the records that were accidentally set with a 'never expire' TTL (-1 in the client). How would I do that? 回答1: Just to clarify, setting a TTL of -1 in the client means never expire (equivalent to a default-ttl of 0 in the server's aerospike.conf file), while setting a TTL of 0 in the client means inherit the default-ttl for this namespace . With Predicate Filtering: If you're using the Java, C, C# and Go clients the easiest way to identify the records with a

ArangoDB and user-defined functions or stored procedures

孤人 提交于 2019-12-23 18:37:54
问题 ArangoDB documentation (Foxx section) says: Because Foxx runs directly inside of ArangoDB it lets you bundle all the database queries and logic necessary to handle a request in one place. Is there any additional way, 'more native', than using the 'Foxx framework' to implement something equivalent to user-defined functions or stored procedures in ArangoDB? 回答1: you can use user defined functions which can be used inside of AQL. UDFs have a clear limited scope of just working with the data you

Aggregation on an array of structs in a map inside a Spark dataframe

余生颓废 提交于 2019-12-23 18:11:04
问题 I apologize for the verbose title, but I really couldn't come up with something better. Basically, I have data with the following schema: |-- id: string (nullable = true) |-- mainkey: map (nullable = true) | |-- key: string | |-- value: array (valueContainsNull = true) | | |-- element: struct (containsNull = true) | | | |-- price: double (nullable = true) | | | |-- recordtype: string (nullable = true) Let me use the following example data: {"id":1, "mainkey":{"key1":[{"price":0.01,"recordtype

Converting PascalCase string to “Friendly Name” in TSQL

折月煮酒 提交于 2019-12-23 16:34:37
问题 I have a table with a column whose values come from an Enumeration. I need to create a TSQL function to convert these values to "Friendly Names" upon retrieval. Examples: 'DateOfBirth' --> 'Date Of Birth' 'PrincipalStreetAddress' --> 'Principal Street Address' I need a straight TSQL UDF solution. I don't have the option of installing Extended Store Procedures or CLR code. 回答1: /* Try this. It's a first hack - still has problem of adding extra space at start if first char is in upper case. */