Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

88
Vistas
Extending Snowflake with Javascript UDFs

I'm trying to extend Snowflake's functionality with generic javascript functions - especially for array processing - i.e. map, filter, reduce.

I've written this simple function which works fine

create function map(A array)
returns array
language javascript
as
$$
return A.map(x => x.balance)
$$

This works fine

select map(myarray) from mytable;

Now I want to pass my map requirement (x => x.balance) as a parameter to the function i.e.

create or replace function map(A array, MAP string)
returns array
language javascript
as
$$
return A.map(MAP)
$$

So I can execute

select map(myarray,'x => x.balance') from mytable;

but this doesn't work - how can I achieve this, and even better if I could create a completely generic snowflake function that give me all JS functions e.g.

create function JS (func string)
returns array
language javascript
as
$$
return func
$$

so I could then just run

select js(myarray.map(x => x.balance)) from mytable;

or then any javascript array function

Many thanks everyone for your suggestions :)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda