<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Understanding Athena Objects on</title><link>https://docs.protegrity.com/cloud-protect/4.0.0/docs/aws/athena/understanding-athena-objects/</link><description>Recent content in Understanding Athena Objects on</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.protegrity.com/cloud-protect/4.0.0/docs/aws/athena/understanding-athena-objects/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://docs.protegrity.com/cloud-protect/4.0.0/docs/aws/athena/understanding-athena-objects/cpa_udf/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.protegrity.com/cloud-protect/4.0.0/docs/aws/athena/understanding-athena-objects/cpa_udf/</guid><description>&lt;h1 id="user-defined-functions">User Defined Functions&lt;/h1>
&lt;p>User Defined Functions (UDF) in Amazon Athena allow users to invoke protect and unprotect operations on data using Athena SQL.&lt;/p>
&lt;p>To use a UDF in Athena, you must declare the USING EXTERNAL FUNCTION clause before the SELECT statement in a SQL query. For example, the following query would perform an unprotect on first_name and last_name fields using the deName element policy:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-gdscript3" data-lang="gdscript3">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">USING&lt;/span> &lt;span style="color:#000">EXTERNAL&lt;/span> &lt;span style="color:#000">FUNCTION&lt;/span> &lt;span style="color:#000">unprotect&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">val&lt;/span> &lt;span style="color:#000">varchar&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#000">el&lt;/span> &lt;span style="color:#000">varchar&lt;/span>&lt;span style="color:#000;font-weight:bold">)&lt;/span> &lt;span style="color:#000">RETURNS&lt;/span> &lt;span style="color:#000">varchar&lt;/span> &lt;span style="color:#000">LAMBDA&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;&amp;lt;replace_with_athena_protect_function_name&amp;gt;:Production&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">SELECT&lt;/span> &lt;span style="color:#000">unprotect&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">first_name&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;deName&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">),&lt;/span> &lt;span style="color:#000">unprotect&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">last_name&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;deName&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">FROM&lt;/span> &lt;span style="color:#000">customers&lt;/span>&lt;span style="color:#000;font-weight:bold">;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Parent topic:&lt;/strong>&lt;a href="https://docs.protegrity.com/cloud-protect/4.0.0/docs/aws/athena/understanding-athena-objects/">Understanding Athena Objects&lt;/a>&lt;/p></description></item></channel></rss>