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
Modifier and TypeFieldDescriptionfinal boolean
static final SqlParserFixture
final @Nullable SqlDialect
final boolean
final SqlTestFactory
static final SqlTestFactory
final StringAndPos
final 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.SqlParserListFixture
list()
Creates an instance of helper classSqlParserListFixture
to 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 classSqlParserListFixture
to 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
-