Calcite - Sql Validation

Card Puncher Data Processing

About

Validation of a sql tree (SqlNode)

How to

Query Planning Utilit

With the query planning utility as shown in the getting started

SqlNode sqlNodeValidated = planner.validate(sqlNode);

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);

Sample code

See live example on github CalciteSqlValidationTest.java





Discover More
Card Puncher Data Processing
Calcite (Farrago, Optiq)

Calcite is a Java SQL Processing engine where the data storage is developed in plugin. Calcite is an open source cost based query optimizer and query execution framework. SQL Parser SQL Validation...
Card Puncher Data Processing
Calcite - Conformance

conformance determines what features the validator will allow does GROUP BY 1 mean group by the first field or the literal 1
Card Puncher Data Processing
Calcite - Getting Started (from Sql to Resultset)

A getting started page that shows a query planning process (ie from sql to resultset process) gerardnico/calcite/blob/master/src/test/java/com/gerardnico/calcite/CalciteFrameworksTest.javaCalciteFrameworksTest.java...
Card Puncher Data Processing
Calcite - Query Planning Process (Sql Processing)

in Calcite The query planning process is the entire process that takes a SQL to a result. The process can be resumed as follow: Phase 1: The Sql statement (Query) is parsed to build a parse tree...
Card Puncher Data Processing
Calcite - Syntax Tree (SqlNode)

SQL tree in Calcite. The tree is build by the parser and each node (Tokens) is represented by SqlNode SqlNode can be converted back to SQL via the unparse...



Share this page:
Follow us:
Task Runner