

The length of string data includes the trailing spaces. The length of binary data includes binary zeros.Įxamples: > SELECT char_length('Spark SQL ') Ĭharacter_length(expr) - Returns the character length of string data or number of bytes of binary data. If n is larger than 256 the result is equivalent to chr(n % 256)Ĭhar_length(expr) - Returns the character length of string data or number of bytes of binary data.


arcsine) the arc sin of expr if -1 SELECT asin(0) Īssert_true(expr) - Throws an exception if expr is not true.Įxamples: > SELECT assert_true(0 SELECT atan(0) Ītan2(expr1, expr2) - Returns the angle in radians between the positive x-axis of a plane and the point given by the coordinates ( expr1, expr2).Īvg(expr) - Returns the mean calculated from values of a group.īase64(bin) - Converts the argument from a binary bin to a base 64 string.īigint(expr) - Casts the value expr to the target data type bigint.īin(expr) - Returns the string representation of the long value expr represented in binary.ġ111111111111111111111111111111111111111111111111111111111110011īinary(expr) - Casts the value expr to the target data type binary.īit_length(expr) - Returns the bit length of string data or number of bits of binary data.Įxamples: > SELECT bit_length('Spark SQL') īoolean(expr) - Casts the value expr to the target data type boolean.īround(expr, d) - Returns expr rounded to d decimal places using HALF_EVEN rounding mode.Ĭast(expr AS type) - Casts the value expr to the target data type type.Ĭbrt(expr) - Returns the cube root of expr.Ĭeil(expr) - Returns the smallest integer not smaller than expr.Ĭeiling(expr) - Returns the smallest integer not smaller than expr.Ĭhar(expr) - Returns the ASCII character having the binary equivalent to expr. ) - Returns an array with the given elements.Īrray_contains(array, value) - Returns true if the array contains the value.Įxamples: > SELECT array_contains(array(1, 2, 3), 2) Īscii(str) - Returns the numeric value of the first character of str.Īsin(expr) - Returns the inverse sine (a.k.a. In this case, returns the approximate percentile array of column col at the givenĮxamples: > SELECT approx_percentile(10.0, array(0.5, 0.4, 0.1), 100) When percentage is an array, each value of the percentage array must be between 0.0 and 1.0. Higher value of accuracy yieldsīetter accuracy, 1.0/accuracy is the relative error of the approximation. The accuracy parameter (default: 10000) is a positive numeric literal whichĬontrols approximation accuracy at the cost of memory. The value of percentage must be between 0.0Īnd 1.0. RelativeSD defines the maximum estimation error allowed.Īpprox_percentile(col, percentage ) - Returns the approximate percentile value of numericĬolumn col at the given percentage. arccosine) of expr if -1 SELECT acos(1) Īdd_months(start_date, num_months) - Returns the date that is num_months after start_date.Īpprox_count_distinct(expr) - Returns the estimated cardinality by HyperLogLog++. > SELECT to_date(' 04:17:52') >= to_date(' 04:17:52') Įxpr1 ^ expr2 - Returns the result of bitwise exclusive OR of expr1 and expr2.Ībs(expr) - Returns the absolute value of the numeric value.Īcos(expr) - Returns the inverse cosine (a.k.a. > SELECT to_date(' 04:17:52') > to_date(' 04:17:52') Įxpr1 >= expr2 - Returns true if expr1 is greater than or equal to expr2. For complex types such array/struct, the data types of fields must For example, map type is not orderable, so it Map type is not supported.įor complex types such array/struct, the data types of fields must be orderable.Įxpr1 = expr2 - Returns true if expr1 equals expr2, or false otherwise.Įxpr1 > expr2 - Returns true if expr1 is greater than expr2.Īnd must be a type that can be ordered. expr1, expr2 - the two expressions must be same type or can be casted to a common type,Īnd must be a type that can be used in equality comparison.SELECT 1 SELECT 1.1 SELECT to_date(' 04:17:52') SELECT to_date(' 04:17:52') SELECT 1 SELECT 2 SELECT 1.0 SELECT to_date(' 04:17:52') SELECT to_date(' 04:17:52') SELECT 1 Įxpr1 expr2 - Returns same result as the EQUAL(=) operator for non-null operands,īut returns true if both are null, false if one of the them is null. It always performs floating point division. Expr1 % expr2 - Returns the remainder after expr1/ expr2.Įxpr1 & expr2 - Returns the result of bitwise AND of expr1 and expr2.Įxpr1 / expr2 - Returns expr1/ expr2.
