-
Notifications
You must be signed in to change notification settings - Fork 32
/
load.sql.sh
57 lines (50 loc) · 2.28 KB
/
load.sql.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
mysql_version="$1"
mysql_version_major=`expr $mysql_version : '\([[0-9]]*\)'`
shift
[ $# -eq 0 ] && enable_all=1
enable_functions="$@"
if_enable() {
[ "$enable_all" = 1 ] && return 0
for func in $enable_functions; do
[ "$func" = "$1" ] && return 0
done
return 1
}
create_agg_function() {
echo "CREATE AGGREGATE FUNCTION $1 RETURNS $2 SONAME 'udf_infusion.so';"
}
create_function() {
echo "CREATE FUNCTION $1 RETURNS $2 SONAME 'udf_infusion.so';"
}
sh unload.sql.sh $mysql_version $enable_functions
if_enable "bound" && create_function "bound" "real"
if_enable "bround" && create_function "bround" "real"
if_enable "corr" && create_agg_function "corr" "real"
if_enable "covariance" && create_agg_function "covariance" "real"
if_enable "cut" && create_function "cut" "string"
if_enable "fnv" && create_function "fnv" "integer"
if_enable "getint" && create_function "getint" "integer"
if_enable "group_first" && create_agg_function "group_first" "string"
if_enable "group_last" && create_agg_function "group_last" "string"
if_enable "invbit" && create_function "invbit" "integer"
if_enable "isbit" && create_function "isbit" "integer"
if_enable "kurtosis" && create_agg_function "kurtosis" "real"
if_enable "lessavg" && create_agg_function "lessavg" "integer"
if_enable "lesspartpct" && create_agg_function "lesspartpct" "integer"
if_enable "lesspart" && create_agg_function "lesspart" "integer"
if_enable "median" && create_agg_function "median" "real"
if_enable "stats_mode" && create_agg_function "stats_mode" "real"
if_enable "ngram" && create_function "ngram" "string"
if_enable "noverk" && create_function "noverk" "integer"
if_enable "percentile_cont" && create_agg_function "percentile_cont" "real"
if_enable "percentile_disc" && create_agg_function "percentile_disc" "real"
if_enable "rotbit" && create_function "rotbit" "integer"
if_enable "rotint" && create_function "rotint" "integer"
if_enable "rsumd" && create_function "rsumd" "real"
if_enable "rsumi" && create_function "rsumi" "integer"
if_enable "setbit" && create_function "setbit" "integer"
if_enable "setint" && create_function "setint" "integer"
if_enable "skewness" && create_agg_function "skewness" "real"
if_enable "slug" && create_function "slug" "string"
if_enable "xround" && create_function "xround" "integer"
true