mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
The prettyprint_duration function takes an integer input containing a number of nanoseconds and returns a human readable value breaking down the input by hours, minutes, seconds, milliseconds, microseconds, and nanoseconds. The prettyprint_bytes function takes an integer input containing a number of bytes and returns a human readable values breaking down the input by gigabytes, megabytes, kilobytes, and bytes. Functionality tests were added to the existing expr-test suite that tests built-in functions. Functional-query workloads were added in two new .test files under the testdata directory to exercise these two new functions. Corresponding pytests were added to run the tests in these new .test files. Benchmarks were added to expr-benchmark, and new benchmarks were generated with a release build running on a machine with the cpu Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz. Documentation was added to the built-in string functions docs. Change-Id: I3e76632ce21ad2ca5df474160338699a542a6913 Reviewed-on: http://gerrit.cloudera.org:8080/21038 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
121 lines
1.6 KiB
Plaintext
121 lines
1.6 KiB
Plaintext
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-1);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-1.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(0);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'0.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(127);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'127.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(128);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'128.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-128);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-128.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-129);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-129.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(32767);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'32.767us'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(32768);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'32.768us'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-32768);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-32768.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-32769);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-32769.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(2147483647);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'2s147ms'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(2147483648);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'2s147ms'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-2147483648);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-2147483648.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-2147483649);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-2147483649.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(9223372036854775807);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'2562047h47m'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(-9223372036854775808);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'-9223372036854775808.000ns'
|
|
====
|
|
---- QUERY
|
|
SELECT PRETTYPRINT_DURATION(NULL);
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
'NULL'
|
|
====
|