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>
56 lines
5.3 KiB
HTML
56 lines
5.3 KiB
HTML
<a name="dli_spark_least"></a><a name="dli_spark_least"></a>
|
|
|
|
<h1 class="topictitle1">least</h1>
|
|
<div id="body8662426"><p id="dli_spark_least__en-us_topic_0000001648161864_p18471163815215">This function is used to return the smallest value in a list of values.</p>
|
|
<div class="section" id="dli_spark_least__en-us_topic_0000001648161864_section45291954203217"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="dli_spark_least__en-us_topic_0000001648161864_screen19928459112517">least(T v1, T v2, ...)</pre>
|
|
</div>
|
|
<div class="section" id="dli_spark_least__en-us_topic_0000001648161864_section992014913317"><h4 class="sectiontitle">Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_spark_least__en-us_topic_0000001648161864_table1829154762513" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="dli_spark_least__en-us_topic_0000001648161864_row8830104792517"><th align="left" class="cellrowborder" valign="top" width="19.220000000000002%" id="mcps1.3.3.2.2.5.1.1"><p id="dli_spark_least__en-us_topic_0000001648161864_p983074711252">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.44%" id="mcps1.3.3.2.2.5.1.2"><p id="dli_spark_least__en-us_topic_0000001648161864_p6830124732517">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.57%" id="mcps1.3.3.2.2.5.1.3"><p id="dli_spark_least__en-us_topic_0000001648161864_p13318164512614">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="51.77%" id="mcps1.3.3.2.2.5.1.4"><p id="dli_spark_least__en-us_topic_0000001648161864_p08301547132513">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_spark_least__en-us_topic_0000001648161864_row15830184792511"><td class="cellrowborder" valign="top" width="19.220000000000002%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_spark_least__en-us_topic_0000001648161864_p683034714250">v1</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.44%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_spark_least__en-us_topic_0000001648161864_p12830184752518">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_spark_least__en-us_topic_0000001648161864_p0318545102615">DOUBLE, BIGINT, or DECIMAL</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="51.77%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_spark_least__en-us_topic_0000001648161864_p18653154615263">The value can be a float or integer.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_spark_least__en-us_topic_0000001648161864_row182402083817"><td class="cellrowborder" valign="top" width="19.220000000000002%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_spark_least__en-us_topic_0000001648161864_p1482552053813">v2</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.44%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_spark_least__en-us_topic_0000001648161864_p1582592083816">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.57%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_spark_least__en-us_topic_0000001648161864_p10825122010388">DOUBLE, BIGINT, or DECIMAL</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="51.77%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_spark_least__en-us_topic_0000001648161864_p1691117578386">The value can be a float or integer.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_spark_least__en-us_topic_0000001648161864_section210162513312"><h4 class="sectiontitle">Return Values</h4><p id="dli_spark_least__en-us_topic_0000001648161864_p184124317231">The return value is of the DOUBLE type.</p>
|
|
<div class="note" id="dli_spark_least__en-us_topic_0000001648161864_note61422099395"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dli_spark_least__en-us_topic_0000001648161864_ul840811320373"><li id="dli_spark_least__en-us_topic_0000001648161864_li0163937193714">If the value of <strong id="dli_spark_least__en-us_topic_0000001648161864_b2402171985517">v1</strong> or <strong id="dli_spark_least__en-us_topic_0000001648161864_b143071922115511">v2</strong> is of the STRING type, an error is reported.</li><li id="dli_spark_least__en-us_topic_0000001648161864_li19408113217376">If the values of all parameters are <strong id="dli_spark_least__en-us_topic_0000001648161864_b182201944165717">NULL</strong>, <strong id="dli_spark_least__en-us_topic_0000001648161864_b513216478577">NULL</strong> is returned.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="dli_spark_least__en-us_topic_0000001648161864_section13277192233920"><h4 class="sectiontitle">Example Code</h4><p id="dli_spark_least__en-us_topic_0000001648161864_p3792454205512">The value <strong id="dli_spark_least__en-us_topic_0000001648161864_b090815311580">1.0</strong> is returned.</p>
|
|
<pre class="screen" id="dli_spark_least__en-us_topic_0000001648161864_screen1886816910567">select least(1,2.0,3,4.0);</pre>
|
|
<p id="dli_spark_least__en-us_topic_0000001648161864_p95431752135517">The value <strong id="dli_spark_least__en-us_topic_0000001648161864_b19525171275820">NULL</strong> is returned.</p>
|
|
<pre class="screen" id="dli_spark_least__en-us_topic_0000001648161864_screen14725101745619">select least(null);</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0473.html">Mathematical Functions</a></div>
|
|
</div>
|
|
</div>
|
|
|