use of com.alibaba.druid.sql.dialect.odps.parser.OdpsLexer in project druid by alibaba.
the class OdpsLexerTest method test_0.
public void test_0() throws Exception {
String str = "DESC;";
OdpsLexer lexer = new OdpsLexer(str);
lexer.nextToken();
assertEquals(Token.DESC, lexer.token());
lexer.nextToken();
assertEquals(Token.SEMI, lexer.token());
}
use of com.alibaba.druid.sql.dialect.odps.parser.OdpsLexer in project druid by alibaba.
the class OdpsLexerTest method test_1.
public void test_1() throws Exception {
String str = "——\n" + "\n" + "drop table if exists tdl_idle_mem_portrait_pred_feats_20210831;";
OdpsLexer lexer = new OdpsLexer(str);
lexer.nextToken();
assertEquals(Token.DROP, lexer.token());
}
use of com.alibaba.druid.sql.dialect.odps.parser.OdpsLexer in project druid by alibaba.
the class OdpsLexerTest method test_4.
public void test_4() throws Exception {
String str = "${PN}_events";
OdpsLexer lexer = new OdpsLexer(str);
lexer.nextToken();
assertEquals(Token.IDENTIFIER, lexer.token());
assertEquals("${PN}_events", lexer.stringVal());
}
use of com.alibaba.druid.sql.dialect.odps.parser.OdpsLexer in project druid by alibaba.
the class OdpsLexerTest method test_2.
public void test_2() throws Exception {
String str = "drop table graph_embedding_dev.04_s1_${bizdate}_0108;";
OdpsLexer lexer = new OdpsLexer(str);
lexer.nextToken();
assertEquals(Token.DROP, lexer.token());
lexer.nextToken();
assertEquals(Token.TABLE, lexer.token());
lexer.nextToken();
assertEquals(Token.IDENTIFIER, lexer.token());
lexer.nextToken();
assertEquals(Token.DOT, lexer.token());
lexer.nextToken();
assertEquals(Token.IDENTIFIER, lexer.token());
assertEquals("04_s1_${bizdate}_0108", lexer.stringVal());
}
use of com.alibaba.druid.sql.dialect.odps.parser.OdpsLexer in project druid by alibaba.
the class OdpsLexerTest method test_error_1.
public void test_error_1() throws Exception {
String str = "`aaa\n${PN}_events";
OdpsLexer lexer = new OdpsLexer(str);
int pos = lexer.pos();
try {
lexer.nextToken();
} catch (ParserException error) {
lexer.skipToNextLineOrParameter(pos);
lexer.nextToken();
}
assertEquals(Token.IDENTIFIER, lexer.token());
assertEquals("${PN}_events", lexer.stringVal());
}
Aggregations