From c35546409489b071f7d55454999a2f0c07e358bc Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Tue, 6 Sep 2016 14:31:25 +0100 Subject: [PATCH] Add blueprints for sql functions --- sql/funcs/abs.go | 15 +++++++++++++++ sql/funcs/avg.go | 15 +++++++++++++++ sql/funcs/count.go | 15 +++++++++++++++ sql/funcs/date.go | 15 +++++++++++++++ sql/funcs/day.go | 15 +++++++++++++++ sql/funcs/difference.go | 15 +++++++++++++++ sql/funcs/distinct.go | 15 +++++++++++++++ sql/funcs/hour.go | 15 +++++++++++++++ sql/funcs/intersect.go | 15 +++++++++++++++ sql/funcs/max.go | 15 +++++++++++++++ sql/funcs/mean.go | 15 +++++++++++++++ sql/funcs/median.go | 15 +++++++++++++++ sql/funcs/min.go | 15 +++++++++++++++ sql/funcs/mins.go | 15 +++++++++++++++ sql/funcs/mode.go | 15 +++++++++++++++ sql/funcs/month.go | 15 +++++++++++++++ sql/funcs/percentile.go | 15 +++++++++++++++ sql/funcs/stddev.go | 15 +++++++++++++++ sql/funcs/sum.go | 15 +++++++++++++++ sql/funcs/union.go | 15 +++++++++++++++ sql/funcs/unixtime.go | 15 +++++++++++++++ sql/funcs/uuid.go | 15 +++++++++++++++ sql/funcs/variance.go | 15 +++++++++++++++ sql/funcs/year.go | 15 +++++++++++++++ 24 files changed, 360 insertions(+) create mode 100644 sql/funcs/abs.go create mode 100644 sql/funcs/avg.go create mode 100644 sql/funcs/count.go create mode 100644 sql/funcs/date.go create mode 100644 sql/funcs/day.go create mode 100644 sql/funcs/difference.go create mode 100644 sql/funcs/distinct.go create mode 100644 sql/funcs/hour.go create mode 100644 sql/funcs/intersect.go create mode 100644 sql/funcs/max.go create mode 100644 sql/funcs/mean.go create mode 100644 sql/funcs/median.go create mode 100644 sql/funcs/min.go create mode 100644 sql/funcs/mins.go create mode 100644 sql/funcs/mode.go create mode 100644 sql/funcs/month.go create mode 100644 sql/funcs/percentile.go create mode 100644 sql/funcs/stddev.go create mode 100644 sql/funcs/sum.go create mode 100644 sql/funcs/union.go create mode 100644 sql/funcs/unixtime.go create mode 100644 sql/funcs/uuid.go create mode 100644 sql/funcs/variance.go create mode 100644 sql/funcs/year.go diff --git a/sql/funcs/abs.go b/sql/funcs/abs.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/abs.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/avg.go b/sql/funcs/avg.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/avg.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/count.go b/sql/funcs/count.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/count.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/date.go b/sql/funcs/date.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/date.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/day.go b/sql/funcs/day.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/day.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/difference.go b/sql/funcs/difference.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/difference.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/distinct.go b/sql/funcs/distinct.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/distinct.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/hour.go b/sql/funcs/hour.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/hour.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/intersect.go b/sql/funcs/intersect.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/intersect.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/max.go b/sql/funcs/max.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/max.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/mean.go b/sql/funcs/mean.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/mean.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/median.go b/sql/funcs/median.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/median.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/min.go b/sql/funcs/min.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/min.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/mins.go b/sql/funcs/mins.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/mins.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/mode.go b/sql/funcs/mode.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/mode.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/month.go b/sql/funcs/month.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/month.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/percentile.go b/sql/funcs/percentile.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/percentile.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/stddev.go b/sql/funcs/stddev.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/stddev.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/sum.go b/sql/funcs/sum.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/sum.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/union.go b/sql/funcs/union.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/union.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/unixtime.go b/sql/funcs/unixtime.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/unixtime.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/uuid.go b/sql/funcs/uuid.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/uuid.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/variance.go b/sql/funcs/variance.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/variance.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs diff --git a/sql/funcs/year.go b/sql/funcs/year.go new file mode 100644 index 00000000..c5523f80 --- /dev/null +++ b/sql/funcs/year.go @@ -0,0 +1,15 @@ +// Copyright © 2016 Abcum Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package funcs