const functions = [
  // aggregators 聚合类
  {
    name: 'SUM',
    type: 'aggregator',
    description: '总计',
    syntax: 'SUM(expression)',
  },
  {
    name: 'AVG',
    type: 'aggregator',
    description: '平均数',
    syntax: 'AVG(expression)',
  },
  {
    name: 'MAX',
    type: 'aggregator',
    description: '最大值',
    syntax: 'MAX(expression)',
  },
  {
    name: 'MIN',
    type: 'aggregator',
    description: '最小值',
    syntax: 'MIN(expression)',
  },
  {
    name: 'COUNT',
    type: 'aggregator',
    description: '计数',
    syntax: 'COUNT(expression)',
  },
  {
    name: 'DISTINCT',
    type: 'aggregator',
    description: '去重计数',
    syntax: 'DISTINCT(expression)',
  },
  {
    name: 'VAR',
    type: 'aggregator',
    description: '方差',
    syntax: 'VAR(expression)',
  },
  {
    name: 'STDDEV',
    type: 'aggregator',
    description: '标准差',
    syntax: 'STDDEV(expression)',
  },
  {
    name: 'MEDIAN',
    type: 'aggregator',
    description: '中位数',
    syntax: 'MEDIAN(expression)',
  },
  // math 数学类
  { name: 'ABS', type: 'math', description: '绝对值', syntax: 'ABS(number)' },
  {
    name: 'CEILING',
    type: 'math',
    description: '向上取整',
    syntax: 'CEILING(number)',
  },
  {
    name: 'FLOOR',
    type: 'math',
    description: '向下取整',
    syntax: 'FLOOR(number)',
  },
  {
    name: 'POWER',
    type: 'math',
    description: '返回指定数字的乘幂',
    syntax: 'POWER(number, power)',
  },
  {
    name: 'ROUND',
    type: 'math',
    description: '按指定位数四舍五入',
    syntax: 'ROUND(number, [decimals])',
  },
  { name: 'SQRT', type: 'math', description: '平方根', syntax: 'SQRT(number)' },
  {
    name: 'EXP',
    type: 'math',
    description: '返回e的n次方',
    syntax: 'EXP(number)',
  },
  {
    name: 'LOG10',
    type: 'math',
    description: '返回以10为底的对数',
    syntax: 'LOG10(number)',
  },
  {
    name: 'LN',
    type: 'math',
    description: '返回数字的自然对数',
    syntax: 'LN(number)',
  },
  {
    name: 'MOD',
    type: 'math',
    description: '取余',
    syntax: 'MOD(number, divisor)',
  },
  { name: 'RAND', type: 'math', description: '随机数', syntax: 'RAND(seed)' },
  {
    name: 'DEGREES',
    type: 'math',
    description: '将弧度转换为角度',
    syntax: 'DEGREES(number)',
  },
  {
    name: 'RADIANS',
    type: 'math',
    description: '将角度转换为弧度',
    syntax: 'RADIANS(number)',
  },
  {
    name: 'TRUNC',
    type: 'math',
    description: '删除数字的小数部分',
    syntax: 'TRUNC(number, decimals)',
  },
  {
    name: 'SIGN',
    type: 'math',
    description: '返回数字的符号',
    syntax: 'SIGN(number)',
  },
  { name: 'ACOS', type: 'math', description: '反余弦', syntax: 'ACOS(number)' },
  { name: 'ASIN', type: 'math', description: '反正弦', syntax: 'ASIN(number)' },
  { name: 'ATAN', type: 'math', description: '反正切', syntax: 'ATAN(number)' },
  {
    name: 'ATAN2',
    type: 'math',
    description: '返回指定的X轴及Y轴坐标值的反正切',
    syntax: 'ATAN2(y, x)',
  },
  { name: 'SIN', type: 'math', description: '正弦', syntax: 'SIN(angle)' },
  { name: 'COS', type: 'math', description: '余弦', syntax: 'COS(angle)' },
  { name: 'TAN', type: 'math', description: '正切', syntax: 'TAN(angle)' },
  { name: 'COT', type: 'math', description: '余切', syntax: 'COT(angle)' },
  // strings 字符串类
  {
    name: 'LENGTH',
    type: 'string',
    description: '字符串长度',
    syntax: 'LENGTH(string)',
  },
  {
    name: 'CONCAT',
    type: 'string',
    description: '字符串拼接',
    syntax: 'CONCAT(string1, string2, string3)',
  },
  {
    name: 'REPLACE',
    type: 'string',
    description: '字符串替换',
    syntax: 'REPLACE(string, substring, replacement)',
  },
  {
    name: 'SUBSTRING',
    type: 'string',
    description: '返回指定位置及长度的子字符串',
    syntax: 'SUBSTRING(string, start, length)',
  },
  {
    name: 'LOWER',
    type: 'string',
    description: '转换为小写',
    syntax: 'LOWER(string)',
  },
  {
    name: 'UPPER',
    type: 'string',
    description: '转换为大写',
    syntax: 'UPPER(string)',
  },
  {
    name: 'LTRIM',
    type: 'string',
    description: '去除前导空格',
    syntax: 'LTRIM(string)',
  },
  {
    name: 'RTRIM',
    type: 'string',
    description: '去除尾部空格',
    syntax: 'RTRIM(string)',
  },
  {
    name: 'TRIM',
    type: 'string',
    description: '去除头尾空格',
    syntax: 'TRIM(string)',
  },
  // date 日期类
  {
    name: 'NOW',
    type: 'date',
    description: '返回当前时间和日期',
    syntax: 'NOW()',
  },
  {
    name: 'SECOND',
    type: 'date',
    description: '返回时间值的秒数',
    syntax: 'SECOND(datetime)',
  },
  {
    name: 'MINUTE',
    type: 'date',
    description: '返回时间值的分钟数',
    syntax: 'MINUTE(datetime)',
  },
  {
    name: 'HOUR',
    type: 'date',
    description: '返回时间值的小时数',
    syntax: 'HOUR(datetime)',
  },
  {
    name: 'DAY',
    type: 'date',
    description: '返回指定日期在当月的第几天',
    syntax: 'DAY(date)',
  },
  {
    name: 'WEEK',
    type: 'date',
    description: '返回日期的在当年的周数',
    syntax: 'WEEK(date)',
  },
  {
    name: 'QUARTER',
    type: 'date',
    description: '返回日期的在当年的季度',
    syntax: 'QUARTER(date)',
  },
  {
    name: 'MONTH',
    type: 'date',
    description: '返回日期中的月份',
    syntax: 'MONTH(date)',
  },
  {
    name: 'YEAR',
    type: 'date',
    description: '返回日期中的年份',
    syntax: 'YEAR(date)',
  },
  {
    name: 'DAY_OF_WEEK',
    type: 'date',
    description: '返回某个日期为一周中的第几天',
    syntax: 'DAY_OF_WEEK(date)',
  },
  {
    name: 'DAY_OF_MONTH',
    type: 'date',
    description: '返回某个日期为当月的第几天',
    syntax: 'DAY_OF_MONTH(date)',
  },
  {
    name: 'DAY_OF_YEAR',
    type: 'date',
    description: '返回某个日期为当年的第几天',
    syntax: 'DAY_OF_YEAR(date)',
  },
  // logic 逻辑类
  {
    name: 'IF',
    type: 'logic',
    description: '判断表达式，如果为真返回参数2，假则返回参数3',
    syntax: 'IF(condition, value_if_true, value_if_false)',
  },
  {
    name: 'COALESCE',
    type: 'logic',
    description: '返回列表中的第一个非空值',
    syntax: 'COALESCE(val1, val2, ...., val_n)',
  },
];

export default functions;
