Package org.apache.calcite.sql.parser
Class SqlParserFixture
java.lang.Object
org.apache.calcite.sql.parser.SqlParserFixture
Helper class for building fluent parser tests such as
sql("values 1").ok();.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanstatic final SqlParserFixturefinal @Nullable SqlDialectfinal booleanfinal SqlTestFactorystatic final SqlTestFactoryfinal StringAndPosfinal SqlParserTest.Tester -
Method Summary
Modifier and TypeMethodDescriptionFlags that this is an expression, not a whole query.expression(boolean expression) Sets whether this is an expression (as opposed to a whole query).hasWarning(Consumer<List<? extends Throwable>> messageMatcher) protected org.apache.calcite.sql.parser.SqlParserListFixturelist()Creates an instance of helper classSqlParserListFixtureto test parsing a list of statements.node()nodeList()parser()same()Changes the SQL.withConfig(UnaryOperator<SqlParser.Config> transform) withConformance(SqlConformance conformance) withConvertToLinux(boolean convertToLinux) Sets whether to convert actual strings to Linux (converting Windows CR-LF line endings to Linux LF) before comparing them to expected.withDialect(SqlDialect dialect) withFactory(UnaryOperator<SqlTestFactory> transform) Creates a copy of this fixture with a new test factory.withTester(SqlParserTest.Tester tester)
-
Field Details
-
FACTORY
-
DEFAULT
-
factory
-
sap
-
expression
public final boolean expression -
tester
-
convertToLinux
public final boolean convertToLinux -
dialect
-
parserChecker
-
-
Method Details
-
same
-
ok
-
compare
-
fails
-
hasWarning
-
node
-
sql
Changes the SQL. -
expression
Flags that this is an expression, not a whole query. -
expression
Sets whether this is an expression (as opposed to a whole query). -
list
protected org.apache.calcite.sql.parser.SqlParserListFixture list()Creates an instance of helper classSqlParserListFixtureto test parsing a list of statements. -
withDialect
-
withFactory
Creates a copy of this fixture with a new test factory. -
withConfig
-
withConformance
-
withTester
-
withConvertToLinux
Sets whether to convert actual strings to Linux (converting Windows CR-LF line endings to Linux LF) before comparing them to expected. Default is true. -
parser
-
node
-
nodeList
-