|
@@ -210,6 +210,307 @@ salary:integer | s:double
|
|
|
73851 | 1330201
|
|
|
;
|
|
|
|
|
|
+log#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+// tag::log[]
|
|
|
+ROW base = 2.0, value = 8.0
|
|
|
+| EVAL s = LOG(base, value)
|
|
|
+// end::log[]
|
|
|
+;
|
|
|
+
|
|
|
+// tag::log-result[]
|
|
|
+base: double | value: double | s:double
|
|
|
+2.0 | 8.0 |3.0
|
|
|
+// end::log-result[]
|
|
|
+;
|
|
|
+
|
|
|
+logofNegativeValue#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 2.0, value = -2
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+warning:Line 2:12: evaluation of [LOG(base, value)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:12: java.lang.ArithmeticException: Log of non-positive number
|
|
|
+
|
|
|
+base: double | value: integer | s:double
|
|
|
+2.0 | -2 | null
|
|
|
+;
|
|
|
+
|
|
|
+logofNegativeBase#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = -2, value = 2.0
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+warning:Line 2:12: evaluation of [LOG(base, value)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:12: java.lang.ArithmeticException: Log of non-positive number
|
|
|
+
|
|
|
+base: integer | value: double | s:double
|
|
|
+-2 | 2.0 | null
|
|
|
+;
|
|
|
+
|
|
|
+logofBaseOne#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 1, value = 2
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+warning:Line 2:12: evaluation of [LOG(base, value)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:12: java.lang.ArithmeticException: Log of base 1
|
|
|
+
|
|
|
+base: integer | value: integer | s:double
|
|
|
+1 | 2 | null
|
|
|
+;
|
|
|
+
|
|
|
+logofZero#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 2.0, value = 0.0
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+warning:Line 2:12: evaluation of [LOG(base, value)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:12: java.lang.ArithmeticException: Log of non-positive number
|
|
|
+
|
|
|
+base:double | value:double | s:double
|
|
|
+2.0 | 0.0 |null
|
|
|
+;
|
|
|
+
|
|
|
+logofNegativeZero#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 2.0, value = -0.0
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+warning:Line 2:12: evaluation of [LOG(base, value)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:12: java.lang.ArithmeticException: Log of non-positive number
|
|
|
+
|
|
|
+base:double | value:double | s:double
|
|
|
+2.0 | -0.0 |null
|
|
|
+;
|
|
|
+
|
|
|
+logofIntLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 10, value = to_long(1000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:integer | value:long | s:double
|
|
|
+10 | 1000000000000 | 12
|
|
|
+;
|
|
|
+
|
|
|
+logofLongInt#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_long(1000000000000), value = 10
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:long | value:integer | s:double
|
|
|
+1000000000000 | 10 | 0.08333333333333333
|
|
|
+;
|
|
|
+
|
|
|
+logofLongLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_long(1000000000000), value = to_long(1000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:long | value:long | s:double
|
|
|
+1000000000000 | 1000000000000 |1.0
|
|
|
+;
|
|
|
+
|
|
|
+logofLongDouble#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_long(1000000000000), value = 10.0
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:long | value:double | s:double
|
|
|
+1000000000000 | 10.0 | 0.08333333333333333
|
|
|
+;
|
|
|
+
|
|
|
+logofDoubleLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 10.0, value = to_long(1000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:double | value:long | s:double
|
|
|
+10.0 | 1000000000000 | 12
|
|
|
+;
|
|
|
+
|
|
|
+logofLongUnsignedLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_long(1000000000000), value = to_ul(1000000000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:long | value:UNSIGNED_LONG | s:double
|
|
|
+1000000000000 | 1000000000000000000 | 1.5
|
|
|
+;
|
|
|
+
|
|
|
+logofUnsignedLongLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_ul(1000000000000000000), value = to_long(1000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:UNSIGNED_LONG | value:long | s:double
|
|
|
+1000000000000000000 | 1000000000000 | 0.6666666666666666
|
|
|
+;
|
|
|
+
|
|
|
+logofIntUnsignedLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 10, value = to_ul(1000000000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:integer | value:UNSIGNED_LONG | s:double
|
|
|
+10 | 1000000000000000000 | 18.0
|
|
|
+;
|
|
|
+
|
|
|
+logofUnsignedLongInt#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_ul(1000000000000000000), value = 10
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:UNSIGNED_LONG | value:integer | s:double
|
|
|
+1000000000000000000 | 10 | 0.05555555555555555
|
|
|
+;
|
|
|
+
|
|
|
+logofUnsignedLongUnsignedLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_ul(1000000000000000000), value = to_ul(1000000000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:UNSIGNED_LONG | value:UNSIGNED_LONG | s:double
|
|
|
+1000000000000000000 | 1000000000000000000 | 1.0
|
|
|
+;
|
|
|
+
|
|
|
+logofUnsignedLongDouble#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = to_ul(1000000000000000000), value = 1000000000.0
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:UNSIGNED_LONG | value:double | s:double
|
|
|
+1000000000000000000 | 1.0E9 | 0.5
|
|
|
+;
|
|
|
+
|
|
|
+logofDoubleUnsignedLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row base = 10.0, value = to_ul(1000000000000000000)
|
|
|
+| EVAL s = LOG(base, value);
|
|
|
+
|
|
|
+base:double | value:UNSIGNED_LONG | s:double
|
|
|
+10.0 | 1000000000000000000 | 18.0
|
|
|
+;
|
|
|
+
|
|
|
+logofInt#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+// tag::logUnary[]
|
|
|
+row value = 100
|
|
|
+| EVAL s = LOG(value);
|
|
|
+// end::logUnary[]
|
|
|
+
|
|
|
+// tag::logUnary-result[]
|
|
|
+value: integer | s:double
|
|
|
+100 | 4.605170185988092
|
|
|
+// end::logUnary-result[]
|
|
|
+;
|
|
|
+
|
|
|
+logofLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row value = to_long(1000000000000)
|
|
|
+| EVAL s = LOG(value);
|
|
|
+
|
|
|
+value: long | s:double
|
|
|
+1000000000000 | 27.631021115928547
|
|
|
+;
|
|
|
+
|
|
|
+logofUnsignedLong#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row value = to_ul(1000000000000000000)
|
|
|
+| EVAL s = LOG(value);
|
|
|
+
|
|
|
+value: unsigned_long | s:double
|
|
|
+1000000000000000000 | 41.44653167389282
|
|
|
+;
|
|
|
+
|
|
|
+logofDouble#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row value = 1000000000000.0
|
|
|
+| EVAL s = LOG(value);
|
|
|
+
|
|
|
+value: double | s:double
|
|
|
+1000000000000.0 | 27.631021115928547
|
|
|
+;
|
|
|
+
|
|
|
+logofNegativeUnary#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row value = -1
|
|
|
+| EVAL s = LOG(value);
|
|
|
+
|
|
|
+warning:Line 2:12: evaluation of [LOG(value)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:12: java.lang.ArithmeticException: Log of non-positive number
|
|
|
+
|
|
|
+value: integer | s:double
|
|
|
+-1 | null
|
|
|
+;
|
|
|
+
|
|
|
+logofZeroUnary#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+row value = 0
|
|
|
+| EVAL s = LOG(value);
|
|
|
+
|
|
|
+warning:Line 2:12: evaluation of [LOG(value)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:12: java.lang.ArithmeticException: Log of non-positive number
|
|
|
+
|
|
|
+value: integer | s:double
|
|
|
+0 | null
|
|
|
+;
|
|
|
+
|
|
|
+logofRefs#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+from employees
|
|
|
+| EVAL l1 = LOG(languages, salary)
|
|
|
+| EVAL l2 = LOG(avg_worked_seconds)
|
|
|
+| EVAL l3 = l1 + l2
|
|
|
+| sort emp_no
|
|
|
+| keep emp_no, languages, salary, avg_worked_seconds, l1, l2, l3
|
|
|
+| limit 5;
|
|
|
+
|
|
|
+warning:Line 2:13: evaluation of [LOG(languages, salary)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:13: java.lang.ArithmeticException: Log of base 1
|
|
|
+
|
|
|
+emp_no:integer | languages:integer | salary:integer | avg_worked_seconds:long | l1:double | l2:double | l3:double
|
|
|
+10001 | 2 | 57305 | 268728049 | 15.806373402659007 | 19.409210455930772 | 35.21558385858978
|
|
|
+10002 | 5 | 56371 | 328922887 | 6.797224072039991 | 19.61133389523871 | 26.408557967278703
|
|
|
+10003 | 4 | 61805 | 200296405 | 7.957717967928651 | 19.115308852397096 | 27.073026820325747
|
|
|
+10004 | 5 | 36174 | 311267831 | 6.5215910639530374 | 19.55616429245569 | 26.07775535640873
|
|
|
+10005 | 1 | 63528 | 244294991 | null | 19.313887032538442 | null
|
|
|
+;
|
|
|
+
|
|
|
+logofRefExps#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+from employees
|
|
|
+| EVAL base = languages * 2
|
|
|
+| EVAL l1 = LOG(base, salary * 2)
|
|
|
+| EVAL l2 = LOG(avg_worked_seconds + 10000) / 2
|
|
|
+| EVAL l3 = l1 + l2
|
|
|
+| sort emp_no
|
|
|
+| keep emp_no, languages, salary, avg_worked_seconds, l1, l2, l3
|
|
|
+| limit 5;
|
|
|
+
|
|
|
+emp_no:integer | languages:integer | salary:integer | avg_worked_seconds:long | l1:double | l2:double | l3:double
|
|
|
+10001 | 2 | 57305 | 268728049 | 8.403186701329505 | 9.704623833790084 | 18.10781053511959
|
|
|
+10002 | 5 | 56371 | 328922887 | 5.052085734770665 | 9.805682148519608 | 14.857767883290272
|
|
|
+10003 | 4 | 61805 | 200296405 | 5.638478645285767 | 9.55767938857962 | 15.196158033865387
|
|
|
+10004 | 5 | 36174 | 311267831 | 4.8594265299129775 | 9.778098209306606 | 14.637524739219582
|
|
|
+10005 | 1 | 63528 | 244294991 | 16.955104980216557 | 9.656963982909355 | 26.612068963125914
|
|
|
+;
|
|
|
+
|
|
|
+logofSort#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+from employees
|
|
|
+| EVAL l1 = LOG(languages, salary)
|
|
|
+| EVAL l2 = LOG(avg_worked_seconds)
|
|
|
+| EVAL l3 = l1 + l2
|
|
|
+| sort l1 ASC nulls last, l2 DESC nulls last
|
|
|
+| keep l1, l2, emp_no, languages, salary, avg_worked_seconds, l3
|
|
|
+| limit 5;
|
|
|
+
|
|
|
+warning:Line 2:13: evaluation of [LOG(languages, salary)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 2:13: java.lang.ArithmeticException: Log of base 1
|
|
|
+
|
|
|
+l1:double | l2:double | emp_no:integer | languages:integer | salary:integer | avg_worked_seconds:long | l3:double
|
|
|
+6.300030441266983 | 19.782340222815456 | 10015 | 5 | 25324 | 390266432 | 26.08237066408244
|
|
|
+6.315083118944484 | 19.132836869278762 | 10035 | 5 | 25945 | 203838153 | 25.447919988223248
|
|
|
+6.428086413501791 | 19.294546217598917 | 10011 | 5 | 31120 | 239615525 | 25.72263263110071
|
|
|
+6.443409317219002 | 19.704129344210816 | 10066 | 5 | 31897 | 360906451 | 26.14753866142982
|
|
|
+6.450671492193451 | 19.538385836155943 | 10087 | 5 | 32272 | 305782871 | 25.989057328349393
|
|
|
+;
|
|
|
+
|
|
|
+logofRenameSort#[skip:-8.12.99,reason:new scalar function added in 8.13]
|
|
|
+from employees
|
|
|
+| RENAME languages as base1
|
|
|
+| EVAL l1 = LOG(base1, salary)
|
|
|
+| EVAL l2 = LOG(avg_worked_seconds)
|
|
|
+| EVAL l3 = l1 + l2
|
|
|
+| sort l1 ASC nulls first, l2 DESC nulls first
|
|
|
+| keep l1, l2, emp_no, base1, salary, avg_worked_seconds, l3
|
|
|
+| limit 5;
|
|
|
+
|
|
|
+warning:Line 3:13: evaluation of [LOG(base1, salary)] failed, treating result as null. Only first 20 failures recorded.
|
|
|
+warning:Line 3:13: java.lang.ArithmeticException: Log of base 1
|
|
|
+
|
|
|
+l1:double | l2:double | emp_no:integer | base1:integer | salary:integer | avg_worked_seconds:long | l3:double
|
|
|
+null | 19.774989878141827 | 10044 | 1 | 39728 | 387408356 | null
|
|
|
+null | 19.739867371666865 | 10027 | null | 73851 | 374037782 | null
|
|
|
+null | 19.73791867352969 | 10020 | null | 40031 | 373309605 | null
|
|
|
+null | 19.732442265367403 | 10025 | null | 47411 | 371270797 | null
|
|
|
+null | 19.72282600331636 | 10024 | null | 64675 | 367717671 | null
|
|
|
+;
|
|
|
+
|
|
|
log10
|
|
|
// tag::log10[]
|
|
|
ROW d = 1000.0
|
|
@@ -238,7 +539,7 @@ warning:Line 1:24: evaluation of [log10(d)] failed, treating result as null. Onl
|
|
|
warning:Line 1:24: java.lang.ArithmeticException: Log of non-positive number
|
|
|
|
|
|
d:double | s:double
|
|
|
-0.0 | null
|
|
|
+0.0 | null
|
|
|
;
|
|
|
|
|
|
log10ofNegativeZero
|