'PySpark SQL forbid certain functions/operators

Given a PySpark SQL such as

park.sql('''select 10%4 as hello ''')  

what is the best way to throw an exception anytime an operator % is used?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source