Calcite - Sql Validation

1 - About

Validation of a sql tree (SqlNode)

3 - How to

3.1 - Query Planning Utilit

With the query planning utility as shown in the getting started


SqlNode sqlNodeValidated = planner.validate(sqlNode);

3.2 - SqlValidatorUtil

With a SqlValidatorUtil. In the example below, you just need to pass a catalogReader.


SqlStdOperatorTable operatorTable = SqlStdOperatorTable.instance();
SqlValidatorWithHints sqlValidator = SqlValidatorUtil.newValidator(
		operatorTable, 
		catalogReader, 
		catalogReader.getTypeFactory(), 
		SqlConformanceEnum.DEFAULT
);
SqlNode sqlValidated = sqlValidator.validate(sqlNode);

4 - Sample code

See live example on github CalciteSqlValidationTest.java


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap