IMPALA-12824: Removes the prettyprint_duration Built-in Function

The prettyprint_duration function was originally
implemented in IMPALA-12824 to work with the workload
management tables which stored durations in integer
nanoseconds. These tables have changed to store decimal
seconds.

The prettyprint_duration function would have required a
large investment of time to make it work with decimal
values, and since the new format is more human readable
anyways, this function has been removed.

Change-Id: If2154c2ed9a7217ed4b7587adeae87df55ff03dc
Reviewed-on: http://gerrit.cloudera.org:8080/21208
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
jasonmfehr
2024-03-25 17:03:33 -07:00
committed by Impala Public Jenkins
parent c8d56425f8
commit 3e4fdeece1
9 changed files with 2 additions and 272 deletions

View File

@@ -1036,13 +1036,6 @@ under the License.
>PRECISION</xref>
</entry>
</row>
<row>
<entry>
<xref href=
"impala_string_functions.xml#string_functions/prettyprint_duration">
PRETTYPRINT_DURATION</xref>
</entry>
</row>
<row>
<entry>
<xref href=

View File

@@ -182,10 +182,6 @@ under the License.
<xref href="#string_functions/parse_url">PARSE_URL</xref>
</li>
<li>
<xref href="#string_functions/prettyprint_duration">PRETTYPRINT_DURATION</xref>
</li>
<li>
<xref href="#string_functions/prettyprint_bytes">PRETTYPRINT_BYTES</xref>
</li>
@@ -1138,45 +1134,6 @@ select instr('foo bar bletch', 'b', 1, 2);
</dlentry>
<dlentry id="prettyprint_duration">
<dt>
PRETTYPRINT_DURATION(TINYINT / SMALLINT / INT / BIGINT nanoseconds)
</dt>
<dd>
<b>Purpose:</b> Formats numeric nanoseconds in a human readable manner.
<p>
<b>Return type:</b> <codeph>STRING</codeph>
</p>
<p>
<b>Usage notes:</b>
</p>
<p>
Negative durations are not fully supported. No conversion to milliseconds/seconds/minutes/hours
is performed. The input value is directly returned with the <codeph>ns</codeph> suffix added.
</p>
<p>
<b>Examples:</b>
</p>
<p>
<codeblock>
select prettyprint_duration(1), prettyprint_duration(12345678), prettyprint_duration(1234567890123), prettyprint_duration(98765432141451), prettyprint_duration(-436512);
+-------------------------+--------------------------------+-------------------------------------+--------------------------------------+-------------------------------+
| prettyprint_duration(1) | prettyprint_duration(12345678) | prettyprint_duration(1234567890123) | prettyprint_duration(98765432141451) | prettyprint_duration(-436512) |
+-------------------------+--------------------------------+-------------------------------------+--------------------------------------+-------------------------------+
| 1.000ns | 12.345ms | 20m34s | 27h26m | -436512.000ns |
+-------------------------+--------------------------------+-------------------------------------+--------------------------------------+-------------------------------+
</codeblock>
</p>
</dd>
</dlentry>
<dlentry id="prettyprint_bytes">
<dt>