Hello Calcite contributors, I would like to have a subclass of CalciteSqlValidator to do custom SqlNode validation.
My planned approach is to make these following changes to allow for this behavior: - Add a Driver.java <https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/jdbc/Driver.java#L62> constructor to allow for setting prepareFactory - Subclass CalcitePrepareImpl, change the createSqlValidator <https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L721> access modifier to protected (from private) and override such that it can return a custom SqlValidator class instead of CalciteSqlValidator <https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L737> - Create a custom SqlValidator class that overrides the validate(SqlNode topNode) <https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L780> with desired custom validation logic. Does anyone have comments or suggestions regarding this use case? Thanks. - Oliver Lee
