forked from adrpar/mysql_udf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
78 lines (45 loc) · 1.73 KB
/
README
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
This is a collection of usefull UDFs that we use at the Leibniz Institute
for Astrophysics in Potsdam.
These are:
- UDF for angular distance using the Vincenty formula
- UDF for up to 10-dim hilbert curve key generation
- UDF for distributed STDDEV calculation (using Welford 1962, Chan et al. 1979)
- UDF for doing nothing for a given number of seconds (sleep)
- UDF for strrpos implementation
To install
----------
1) Download the mysql source corresponding to your installed
version. Building mysql from scratch is recommended.
Note: ONLY MYSQL VERSION 5.5 AND ABOVE ARE CURRENTLY
SUPPORTED
2) edit CMakeList.txt accordingly to point to the directory
where mysql is installed.
3) edit CMakeList.txt accordingly to point to the directory
of the mysql sources
4) mkdir build
cd build
5) cmake ..
6) make
7) make install
8) log into mysql server as root and execute the commands in
install_udfs.sql
This will setup the neccessary tables, install the plugin
and create all the UDFs needed to administer the queue.
How to use
----------
udf_angdist:
angdist(pointA RA (degree), pointA DEC (degree), pointB RA (degree), pointB DEC (degree))
udf_hilbert:
hilbertKey(hilbert order, box size, num dim, x, y, z, ... )
coordFromHilbertKey(hilbert order, box size, num dim, hilbert key, current dimension (separate call for each dimension))
udf_sleep:
idle(num seconds)
udf_strrpos:
strrpos(haystack, needle)
udf_sum_of_squares:
sum_of_squares(number)
udf_partitAdd_sum_of_squares:
partitadd_sum_of_sqares(PART_M2, PART_MEAN, PART_COUNT)
* - par1: PART_M2: the sum of squares for a given partition
* - par2: PART_MEAN: the mean for a given partition
* - par3: PART_COUNT: the number of elements in the partition