doc-exports/docs/dli/sqlreference/dli_08_0296.html
Su, Xiaomeng 04d4597cf3 dli_sqlreference_0511_version
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>
2023-11-02 14:34:08 +00:00

25 lines
2.8 KiB
HTML

<a name="dli_08_0296"></a><a name="dli_08_0296"></a>
<h1 class="topictitle1">CREATE FUNCTION</h1>
<div id="body8662426"><div class="section" id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_section12316122121119"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_screen12287201515117">CREATE FUNCTION
[IF NOT EXISTS] function_name
AS identifier [LANGUAGE JAVA|SCALA]</pre>
</div>
<div class="section" id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_section1428412421113"><h4 class="sectiontitle">Function</h4><p id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_p1445613466116">Create a user-defined function.</p>
</div>
<div class="section" id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_section20691410191215"><h4 class="sectiontitle">Description</h4><p id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_p58431929121213"><strong id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_b69401737191213">IF NOT EXISTS</strong></p>
<p id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_p38431529111219">If the function already exists, nothing happens.</p>
<p id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_p684302914129"><strong id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_b1571664017125">LANGUAGE JAVA|SCALA</strong></p>
<p id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_p1784316298122">Language tag is used to instruct Flink runtime how to execute the function. Currently only <strong id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_b4722103318416">JAVA</strong> and <strong id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_b20331838146">SCALA</strong> are supported, the default language for a function is <strong id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_b1591314571544">JAVA</strong>.</p>
</div>
<div class="section" id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_section238319459178"><h4 class="sectiontitle">Example</h4><p id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_p93925450178">Create a function named <strong id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_b12995271956">STRINGBACK</strong>.</p>
<pre class="screen" id="dli_08_0296__en-us_topic_0000001119232076_en-us_topic_0000001087544630_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_0293.html">Data Definition Language (DDL)</a></div>
</div>
</div>