impala sql

Analytic:

CUME_DIST () over (by Order) : full table of data or less than the total number of records and the record

LAG () over (by Partition) : Take the specified field value records

Lead () over (by Partition) : Take specified field values in records

NTILE (n-) over (by Order) : all records in the specified field in the 1 / n

Percent () over (by Partition) : Percentage

Date:

current_timestamp () and now () is equivalent to : the current timestamp

FROM_UNIXTIME () : Switch to unix time 

unix_timestamp () : Switch to unix timestamp

Find the time difference ( first differencing into the number of seconds, minutes, empathy ) : the SELECT FROM_UNIXTIME (timestamp1) -from_unixtime (timestamp2)

Switch timestamp ( sensitive note time format : from_timestamp ( '2019-11-12', 'YYYY / the MM / dd HH: mm: SS: SSSSSS')

DATE_ADD ( '2019-10-10',. 3) : After three days

date_sub ( '2019-10-10', 3) is equivalent to SUBDATE ( '2019-10-10',. 3) : three days

DATEDIFF (new new, Old) : date interval

timestamp_cmp (new new, Old) : differencing timestamp, the result is the difference between the number of days

DAYOFWEEK : The first few days a week (Sunday is the first day abroad)

String:

base64decode (string str): base64 decoding.
Base64Encode (STR String): Base64 encoding.

CONCAT_WS ( '-', 'A', 'B', ...) : splicing the specified string delimiter

FIND_IN_SET (STR String, String strlist) : search string in a comma-separated list strlist string, the result is a list of indices, the subscript starting at 1, 0 is not found there, if one of two parameters null, the return value is null.

TypeConversion:

cast(): cast('1' as BIGINT)

Published 25 original articles · won praise 1 · views 10000 +

Guess you like

Origin blog.csdn.net/kimi_Christmas/article/details/103288730