blob: 59d071488aaa237a664a34ab46b5c27cb96e4dcd [file] [log] [blame] [view]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
# Apache DataSketches library functions for Google BigQuery
[User-Defined Aggregate Functions (UDAFs)](https://cloud.google.com/bigquery/docs/user-defined-aggregates) and
[non-aggregate (scalar) functions (UDFs)](https://cloud.google.com/bigquery/docs/user-defined-functions) for BigQuery SQL engine.
Please visit the main
[Apache DataSketches website](https://datasketches.apache.org)
for more information about DataSketches library.
If you are interested in making contributions to this project please see our
[Community](https://datasketches.apache.org/docs/Community/)
page for how to contact us.
## Requirements
- Requires [Emscripten (emcc compiler)](https://emscripten.org/)
- Requires a link to **/datasketches-cpp** in this repository
- Requires make utility
- Requires [Google Cloud CLI](https://cloud.google.com/sdk/docs/install)
## Building, Installing, and Testing
- Requires setting environment variables
- GCS_BUCKET: to hold compiled artifacts
- BQ_DATASET: location of stored SQL functions (routines)
```
make # performs compilation
make install # upload to $GCS_BUCKET & create functions in $BQ_DATASET
make test # runs predefined tests in BQ
```
The above steps can be executed in the root directory to install everything, or can be run from an individual sketch directory to install only that particular sketch.
## Examples
For examples see test directories in individual sketch directories.