HPL/SQL is included to Apache Hive since version 2.0
GET DIAGNOSTICS statement allows you to retrieve the error message, the number of rows about the previous SQL statement.
Get the error text:
GET DIAGNOSTICS EXCEPTION 1 var_name = MESSAGE_TEXT;
Get the number of rows associate with the previous SQL statement:
GET DIAGNOSTICS var_name = ROW_COUNT;
Compatibility: IBM DB2
Version: PL/HQL 0.03