Home > Mobile >  how create stored procedure in athena aws from s3?
how create stored procedure in athena aws from s3?

Time:09-28

I need to create procedural logic using data stored in aws s3 from athena or glue. actually it is migrating a stored procedure from sql server to aws, but I don't know what aws service or where to do it with, it doesn't use database but s3 tables. Thank you very much for guiding me on how to do it.

CodePudding user response:

Athena doesn't support stored procedures, but however you can leverage UDFs to define the same logic as in your source stored procedure.

Below is the syntax for an UDF and refer to this for more information:

USING EXTERNAL FUNCTION UDF_name(variable1 data_type[, variable2 data_type][,...])
RETURNS data_type
LAMBDA 'lambda_function'
SELECT  [...] UDF_name(expression) [...]

CodePudding user response:

Thank you very much, and these UDFs can be executed from glue? In short, what I need to do is work the TABLES hosted in S3, to do a JOIN, enrich the data and finally perform an INSERT to a final table. therefore, I need to migrate the SQL SERVER STORED PROCEDURE logic to the AWS platform, and for this, I hope to preferably use the glue or athena or lambda service or another, because we do not have a database in AWS.

  • Related