forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
30 lines
3.0 KiB
HTML
30 lines
3.0 KiB
HTML
<a name="dli_08_15010"></a><a name="dli_08_15010"></a>
|
|
|
|
<h1 class="topictitle1">CREATE FUNCTION</h1>
|
|
<div id="body0000001310015797"><div class="section" id="dli_08_15010__section1428412421113"><h4 class="sectiontitle">Function</h4><p id="dli_08_15010__p10858182784917">To create a catalog function with a catalog and a database namespace, you will need to specify an identifier. You can specify a language tag. You cannot register the function if a function with the same name has already been registered in the catalog. If the language tag is <strong id="dli_08_15010__b1772914832213">JAVA</strong> or <strong id="dli_08_15010__b822619504227">SCALA</strong>, the identifier is the fully qualified name of the UDF implementation class.</p>
|
|
<p id="dli_08_15010__p31966494138">For details about how to create a UDF, see <a href="dli_08_15082.html">UDFs</a>.</p>
|
|
</div>
|
|
<div class="section" id="dli_08_15010__section12316122121119"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="dli_08_15010__screen12287201515117">CREATE [TEMPORARY|TEMPORARY SYSTEM] FUNCTION
|
|
[IF NOT EXISTS] [[catalog_name.]db_name.]function_name
|
|
AS identifier [LANGUAGE JAVA|SCALA]</pre>
|
|
</div>
|
|
<div class="section" id="dli_08_15010__section20691410191215"><h4 class="sectiontitle">Description</h4><p id="dli_08_15010__p206712597494"><strong id="dli_08_15010__b3612158135011">TEMPORARY</strong></p>
|
|
<p id="dli_08_15010__p96711459134910">Create a temporary catalog function with catalogs and database namespaces and overwrite the original catalog function.</p>
|
|
<p id="dli_08_15010__p3671959184913"><strong id="dli_08_15010__b12325121215508">TEMPORARY SYSTEM</strong></p>
|
|
<p id="dli_08_15010__p1967112599499">Create a temporary system catalog function without database namespaces and overwrite the system's built-in functions.</p>
|
|
<p id="dli_08_15010__p126714597496"><strong id="dli_08_15010__b82341514509">IF NOT EXISTS</strong></p>
|
|
<p id="dli_08_15010__p667111593497">If the function already exists, nothing happens.</p>
|
|
<p id="dli_08_15010__p13671105954910"><strong id="dli_08_15010__b975622111509">LANGUAGE JAVA|SCALA</strong></p>
|
|
<p id="dli_08_15010__p1367125944918">The language tag is used to instruct Flink runtime how to execute the function. Currently, only <strong id="dli_08_15010__b14644193614195">JAVA</strong> and <strong id="dli_08_15010__b17647173681919">SCALA</strong> language tags are supported, and the default language for a function is <strong id="dli_08_15010__b264953651911">JAVA</strong>.</p>
|
|
</div>
|
|
<div class="section" id="dli_08_15010__section238319459178"><h4 class="sectiontitle">Example</h4><p id="dli_08_15010__p93925450178">Create a function named <strong id="dli_08_15010__b80871179545257">STRINGBACK</strong>.</p>
|
|
<pre class="screen" id="dli_08_15010__screen13393144514174">create function STRINGBACK as 'com.dli.StringBack'</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_15005.html">Data Definition Language (DDL)</a></div>
|
|
</div>
|
|
</div>
|
|
|