veDB MySQL 版本整个系统对 MySQL 完全兼容,在 OLAP 侧可以进行执行加速的数据类型、函数如下:
类别 | 数据类型 |
---|---|
Numeric | TINYINT[(M)] [UNSIGNED] [ZEROFILL] |
BOOL, BOOLEAN | |
SMALLINT[(M)] [UNSIGNED] [ZEROFILL] | |
MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL] | |
INT[(M)] [UNSIGNED] [ZEROFILL] | |
INTEGER[(M)] [UNSIGNED] [ZEROFILL] | |
BIGINT[(M)] [UNSIGNED] [ZEROFILL] | |
DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL] | |
DEC[(M[,D])] [UNSIGNED] [ZEROFILL] | |
FLOAT[(M,D)] [UNSIGNED] [ZEROFILL] | |
FLOAT(p) [UNSIGNED] [ZEROFILL] | |
DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL] | |
DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL] | |
Date & Time | DATE |
DATETIME[(fsp)] | |
TIMESTAMP[(fsp)] | |
TIME[(fsp)] | |
YEAR[(4)] | |
String | [NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE collation_name] |
[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE collation_name] | |
BINARY[(M)] | |
VARBINARY(M) | |
TINYBLOB | |
TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name] | |
BLOB[(M)] | |
TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name] | |
MEDIUMBLOB | |
MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name] | |
LONGBLOB | |
LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name] | |
JSON | JSON |
字符集 | 描述 | 对应默认字符集排序 | 字符集排序 |
---|---|---|---|
binary | Binary pseudo charset | binary | binary |
latin1 | cp1252 West European | latin1_swedish_ci | latin1_swedish_ci |
utf8mb3 | UTF-8 Unicode | utf8_general_ci | utf8mb3_bin |
utf8mb3_general_ci | |||
utf8mb4 | UTF-8 Unicode | utf8mb4_0900_ai_ci | utf8mb4_0900_ai_ci |
utf8mb4_bin | |||
utf8mb4_general_ci |
函数类别 | 函数 |
---|---|
Numeric | %, MOD |
* | |
+ | |
- (减法) | |
- (负数) | |
/ | |
DIV | |
ABS(X) | |
ACOS(X) | |
ASIN(X) | |
ATAN(X) | |
CEIL(X) | |
CEILING(X) | |
COS(X) | |
DEGREES(X) | |
EXP(X) | |
FLOOR(X) | |
LN(X) | |
LOG(X), LOG(B,X) | |
LOG10(X) | |
LOG2(X) | |
MOD(N,M), N % M, N MOD M | |
PI() | |
POW(X, Y) | |
POWER(X, Y) | |
RADIANS(X) | |
RAND([N]) | |
ROUND(X),ROUND(X,D) | |
SIGN(X) | |
SIN(X) | |
SQRT(X) | |
TAN(X) | |
TRUNCATE(X,D) | |
Date & Time | ADDDATE(date,INTERVAL expr unit) |
CONVERT_TZ(dt,from_tz,to_tz) | |
DATEDIFF(expr1,expr2) | |
DATE_ADD(date,INTERVAL expr unit) | |
DATE_FORMAT(date, format) | |
DATE_SUB(date,INTERVAL expr unit) | |
DAY(date) | |
DAYNAME(date) | |
DAYOFMONTH(date) | |
DAYOFWEEK(date) | |
DAYOFYEAR(date) | |
EXTRACT(unit FROM date) | |
FROM_DAYS(N) | |
FROM_UNIXTIME(unix_timestamp[,format]) | |
HOUR(time) | |
LAST_DAY(date) | |
MINUTE(time) | |
MONTH(date) | |
MONTHNAME(date) | |
QUARTER(date) | |
SECOND(time) | |
SUBDATE(date,INTERVAL expr unit) | |
TIMESTAMPADD(unit,interval,datetime_expr) | |
TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2) | |
TO_DAYS(date) | |
TO_SECONDS(expr) | |
UNIX_TIMESTAMP([date]) | |
WEEK(date[,mode]) | |
WEEKDAY(date) | |
WEEKOFYEAR(date) | |
YEAR(date) | |
YEARWEEK(date), YEARWEEK(date,mode) | |
Flow Control | CASE value WHEN compare_value THEN result [WHEN compare_value THEN result ...] [ELSE result] END |
IF(expr1,expr2,expr3) | |
IFNULL(expr1,expr2) | |
NULLIF(expr1,expr2) | |
String | ASCII(str) |
BIN(N) | |
CHAR(N,... [USING charset_name]) | |
CHAR_LENGTH(str) | |
CHARACTER_LENGTH(str) | |
CONCAT(str1,str2,...) | |
CONCAT_WS(separator,str1,str2,...) | |
FIND_IN_SET(str,strlist) | |
HEX(str) | |
INSTR(str,substr) | |
LCASE(str) | |
LEFT(str,len) | |
LENGTH(str) | |
expr LIKE pat [ESCAPE 'escape_char'] | |
LOCATE(substr,str) | |
LOWER(str) | |
LPAD(str,len,padstr) | |
LTRIM(str) | |
MID(str,pos,len) | |
OCTET_LENGTH(str) | |
POSITION(substr IN str) | |
expr REGEXP pat | |
REGEXP_INSTR(expr, pat[, pos[, occurrence[, return_option[, match_type]]]]) | |
REGEXP_LIKE(expr, pat[, match_type]) | |
REGEXP_REPLACE(expr, pat, repl[, pos[, occurrence[, match_type]]]) | |
REGEXP_SUBSTR(expr, pat[, pos[, occurrence[, match_type]]]) | |
REPEAT(str,count) | |
REPLACE(str,from_str,to_str) | |
REVERSE(str) | |
RIGHT(str,len) | |
expr RLIKE pat | |
RPAD(str,len,padstr) | |
RTRIM(str) | |
SOUNDEX(str) | |
expr1 SOUNDS LIKE expr2 | |
SPACE(N) | |
STRCMP(expr1,expr2) | |
SUBSTR(str,pos) | |
SUBSTRING(str,pos) | |
SUBSTRING_INDEX(tr,delim,count) | |
TRIM([{BOTH | |
UCASE(str) | |
UPPER(str) | |
Cast | CAST(expr AS type [ARRAY]) |
CONVERT(expr USING transcoding_name) | |
JSON | column->path |
JSON_CONTAINS(target, candidate[, path]) | |
JSON_EXTRACT(json_doc, path[, path] ...) | |
JSON_KEYS(json_doc[, path]) | |
JSON_LENGTH(json_doc[, path]) | |
JSON_UNQUOTE(json_val) | |
JSON_VALID(val) | |
Aggregation | AVG([DISTINCT] expr) [over_clause] |
COUNT(expr) [over_clause] | |
COUNT(DISTINCT expr,[expr...]) | |
GROUP_CONCAT(expr) | |
JSON_ARRAYAGG(col_or_expr) [over_clause] | |
MAX([DISTINCT] expr) [over_clause] | |
MIN([DISTINCT] expr) [over_clause] | |
STD(expr) [over_clause] | |
STDDEV(expr) [over_clause] | |
STDDEV_POP(expr) [over_clause] | |
STDDEV_SAMP(expr) [over_clause] | |
SUM([DISTINCT] expr) [over_clause] | |
VAR_POP(expr) [over_clause] | |
VAR_SAMP(expr) [over_clause] | |
VARIANCE(expr) [over_clause] |