SqlValidator
A utility object that provides functionality for SQL validation and schema handling. This includes methods for checking SQL query syntax, validating against schemas, managing schemas from definition files, and ensuring data type consistency during validation.
Functions
Loads SQL schema definitions from the specified directory, processes each .sql
file encountered, and constructs a representation of the database schema consisting of tables and their columns.
Validates the provided SQL query schema against Calcite's SQL parser and validator. Optionally applies custom literal type checks if the VALIDATE_LITERAL_TYPES
flag is enabled.
Validates the syntax of an SQL query by attempting to parse it. If the SQL syntax is invalid, an error is thrown with a message indicating the issue.