use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.
the class Oracle2PG_DataTypeTest_number_int method test_oracle2pg_int_11.
public void test_oracle2pg_int_11() throws Exception {
String sql = "number(11, 0)";
SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
assertEquals("BIGINT", pgDataType.toString());
}
use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.
the class Oracle2PG_DataTypeTest_number_int method test_oracle2pg_int_7.
public void test_oracle2pg_int_7() throws Exception {
String sql = "number(7, 0)";
SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
assertEquals("INT", pgDataType.toString());
}
use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.
the class Oracle2PG_DataTypeTest_number_int method test_oracle2pg_int_8.
public void test_oracle2pg_int_8() throws Exception {
String sql = "number(8, 0)";
SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
assertEquals("INT", pgDataType.toString());
}
use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.
the class Oracle2PG_DataTypeTest_number_int method test_oracle2pg_int_18.
public void test_oracle2pg_int_18() throws Exception {
String sql = "number(18, 0)";
SQLDataType dataType = SQLParserUtils.createExprParser(sql, JdbcConstants.ORACLE).parseDataType();
SQLDataType pgDataType = SQLTransformUtils.transformOracleToPostgresql(dataType);
assertEquals("BIGINT", pgDataType.toString());
}
use of com.alibaba.druid.sql.ast.SQLDataType in project druid by alibaba.
the class TPCDS_ALL_Resolve method test_q01.
public void test_q01() throws Exception {
for (int q = 1; q <= 99; ++q) {
System.out.println("tpcds query-" + q);
System.out.println("-----------------------------------------------------");
String sql = TPCDS.getQuery(q);
final List<SQLStatement> statements = SQLUtils.parseStatements(sql, DbType.mysql);
for (SQLStatement stmt : statements) {
repository.resolve(stmt);
final SQLSelect select = ((SQLSelectStatement) stmt).getSelect();
final SQLSelectQueryBlock firstQueryBlock = select.getFirstQueryBlock();
if (firstQueryBlock == null) {
continue;
}
final List<SQLSelectItem> selectList = firstQueryBlock.getSelectList();
for (int i = 0; i < selectList.size(); i++) {
SQLSelectItem selectItem = selectList.get(i);
if (selectItem.getExpr() instanceof SQLAllColumnExpr) {
continue;
}
final SQLDataType dataType = selectItem.computeDataType();
if (dataType == null) {
// fail("dataType is null : " + selectItem);
}
}
}
}
}
Aggregations