apache / drill

Apache Drill is a distributed MPP query layer for self describing data
https://drill.apache.org/
Apache License 2.0
1.94k stars 980 forks source link

DRILL-8433: Add Percent Change UDF to Drill #2801

Closed cgivre closed 1 year ago

cgivre commented 1 year ago

DRILL-8433: Add Percent Change UDF to Drill

Description

Adds a new UDF, percent_change(x,y) which calculates the percent change between the two variables. While this is relatively easy to do in SQL, it also requires null and zero checks to prevent division by zero errors. This makes this calculation simpler.

Documentation

See README.

Testing

Added unit tests.