use of org.apache.flink.sql.parser.impl.FlinkSqlParserImpl in project flink by apache.
the class TableApiIdentifierParsingTest method createFlinkParser.
private FlinkSqlParserImpl createFlinkParser(String expr) {
SourceStringReader reader = new SourceStringReader(expr);
FlinkSqlParserImpl parser = (FlinkSqlParserImpl) FlinkSqlParserImpl.FACTORY.getParser(reader);
parser.setTabSize(1);
parser.setUnquotedCasing(Lex.JAVA.unquotedCasing);
parser.setQuotedCasing(Lex.JAVA.quotedCasing);
parser.setIdentifierMaxLength(256);
parser.setConformance(FlinkSqlConformance.DEFAULT);
parser.switchTo(SqlAbstractParserImpl.LexicalState.BTID);
return parser;
}
use of org.apache.flink.sql.parser.impl.FlinkSqlParserImpl in project flink by apache.
the class TableApiIdentifierParsingTest method testTableApiIdentifierParsing.
@Test
public void testTableApiIdentifierParsing() throws ParseException {
FlinkSqlParserImpl parser = createFlinkParser(stringIdentifier);
SqlIdentifier sqlIdentifier = parser.TableApiIdentifier();
assertThat(sqlIdentifier.names, equalTo(expectedParsedIdentifier));
}
Aggregations