Category "user-defined-functions"

Scala spark UDF function that takes input and puts it in an Array

I am trying to create a Scala UDF for Spark, that can be used in Spark SQL. The objective of the function is to accept any column type as input, and put it in a

Amazon Athena external lambda function (udf) - create view

I am trying to create an external function in Athena using AWS Lambda function. I am able to do so and query successfully using Athena query editor. Code is bel

access objects in pyspark user-defined function from outer scope, avoid PicklingError: Could not serialize object

How do I avoid initializing a class within a pyspark user-defined function? Here is an example. Creating a spark session and DataFrame representing four latitu

Spark scala data frame udf returning rows

Say I have an dataframe which contains a column (called colA) which is a seq of row. I want to to append a new field to each record of colA. (And the new filed

Excel UDF to Unpivot (Melt, Reverse pivot, Flatten, Normalize) blocks of data within Tables

This question will seek multiple approaches LET/LAMBDA VBA UDF and Power Query Function, so there will be no single right answer, but a solicitation of approach

How to avoid multiple function evals with the (func()).* syntax in a query?

Context When a function returns a TABLE or a SETOF composite-type, like this one: CREATE FUNCTION func(n int) returns table(i int, j bigint) as $$ BEGIN RETUR

Distribute group tasks evenly using pandas_udf in PySpark

I have a Spark Dataframe which contains groups of training data. Each group is identified by the "group" column. group | feature_1 | feature_2 | label --------

How do I create a SQL Function to return a BIT?

I am using this script below to create a function but I get an error in the messages log: CREATE FUNCTION [dbo].[MyFunction] () RETURNS BIT AS RETURN CAST(1 AS