Hive built-in functions

1. Relational operations:
1. Equal comparison: =
2. Equal comparison: <=>
3. Unequal comparison: <> and !=
4. Less than comparison: <
5. Less than or equal comparison: <=
6. Greater than Comparison: >
7. Greater than or equal comparison: >=
8. Interval comparison
9. Null judgment: IS NULL
10. Non-null judgment: IS NOT NULL
10. LIKE comparison: LIKE
11. JAVA LIKE operation: RLIKE
12. REGEXP operation : REGEXP


2. Mathematical operations: 
1. Addition operation: +
2. Subtraction operation: –
3. Multiplication operation: *
4. Division operation: /
5. Remainder operation: %
6. Bit AND operation: &
7. Bit OR operation : |
8. Bit XOR: ^
9. Bit inversion operation: ~


3. Logical operation:  
1. Logical AND operation: AND, &&
2. Logical OR operation: OR, ||
3. Logical NOT operation: NOT, !


Fourth, composite type constructor    
1. map structure
2 .struct structure
3. named_struct structure
4. array structure
5. create_union


5. Composite type operator 
1. Get elements in array
2. Get elements in map
3. Get elements in struct


6.   Numerical calculation function
1. Rounding function: round
2. Specify the precision round function: round
3. The round down function: floor
4. The round up function: ceil
5. The round up function: ceiling
6. The random number function: rand
7. The natural exponential function: exp
8 . Base 10 logarithmic function: log10
9. Base 2 logarithmic function: log2
10. Logarithmic function: log
11. Power function: pow
12. Power function: power
13. Square root function: sqrt
14 . Binary function: bin
15. Hexadecimal function: hex
16. Reverse hexadecimal function: unhex
17. Hexadecimal conversion function: conv
18. Absolute value function: abs
19. Positive remainder function: pmod
20. Sine function: sin
21. Arc sine function: asin
22. Cosine function: cos
23. Arc cosine function: acos
24. Positive function: positive
25. Negative function: negative


7. Set operation function    
1. Map type size: size
2. Array type size: size
3. Determine whether the element array contains elements: array_contains
4. Get all the value sets
in the map 5. Get all the key sets in the map
6. Array sorting


8.  Type conversion function
1. Binary conversion: binary
2. Force conversion between basic types : cast


9. Date function   
1. UNIX timestamp to date function: from_unixtime
2. Get current UNIX timestamp function: unix_timestamp
3. Date to UNIX timestamp function: unix_timestamp
4. Specify the format date to UNIX timestamp function: unix_timestamp
5. Date time to date function: to_date
6. Date to year function: year
7. Date to month function: month
8. Date to day function: day
9. Date to hour function: hour
10. Date-to-minute function: minute
11. Date-to-second function: second
12. Date-to-week function: weekofyear
13. Date comparison function: datediff
14. Date increase function: date_add
15. Date decrease function: date_sub


10. Condition function   
1 .If function: if
2. Non-empty search function: COALESCE
3. Conditional judgment function: CASE
4. Conditional judgment function: CASE


11. String function  
1. Character ascii code function: ascii
2. Base64 string
3. String Connection function: concat
4. String connection function with delimiter: concat_ws
5. Function to convert array to string: concat_ws
6. Decimal place to format string function: format_number
7. String interception function: substr, substring
8. Character String interception function: substr, substring
9. String search function: instr
10. String length function: length
11. String search function: locate
12. String formatting function: printf
13. String conversion function: str_to_map
14. Base64 decoding function: unbase64(string str)
15. String-to-uppercase function: upper, ucase
16. String-to-lowercase function: lower, lcase
17. Space removal function: trim
18. Left space removal function: ltrim
19. Right to remove space function: rtrim
20. Regular expression replacement function: regexp_replace
21. Regular expression parsing function: regexp_extract
22. URL parsing function: parse_url
23. JSON parsing function: get_json_object
24. Space string function: space
25. Repeat characters String function: repeat
26. Left complement function: lpad
27. Right complement function: rpad
28. Split string function: split
29. Set search function: find_in_set
30. Word segmentation function: sentences
31. After word segmentation, count the TOPs with the highest frequency together -K 32.   Count the TOP-K with the highest frequency of occurrence of the specified
word after word segmentation Parse XML functions   









1. xpath
2. xpath_string 3.
xpath_boolean
4. xpath_short, xpath_int, xpath_long 5. 
xpath_float, xpath_double , xpath_number Value statistics function: avg 4. Minimum value statistics function: min 5. Maximum value statistics function: max 6. Non-empty set population variable function: var_pop 7. Non-empty set sample variable function: var_samp 8. Population standard deviation function: stddev_pop 9 . Sample standard deviation function: stddev_samp 10. Median function: percentile 11. Median function: percentile 12. Approximate median function: percentile_approx 13. Approximate median function: percentile_approx 14. Histogram: histogram_numeric 15. Set deduplication: collect_set 16. Set not Deduplication function: collect_list





















15. Table-Generating Functions (UDTF)  
1. Split the array into multiple rows: explode
2. Split the map into multiple rows: explode

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324714904&siteId=291194637