HPL/SQL is included to Apache Hive since version 2.0
You can use (-) arithmetic operator to subtract two numbers, or subtract the number of days from a DATE value.
expr - expr
When you subtract two integer values the result of the operation also has an integer value.
|3 - 1||2||Integer|
When you subtract an integer from a DATE value, PL/HQL subtracts the number of days from the DATE and the result of the operation is a DATE value.
|DATE '2015-01-01' - 1||DATE '2014-12-31'||DATE|