fix(数据源): 修复ClickHouse日期格式化问题
This commit is contained in:
parent
cac6b54457
commit
cf99af536c
2
pom.xml
2
pom.xml
@ -30,7 +30,7 @@
|
|||||||
<mybatis-plus.version>3.5.6</mybatis-plus.version>
|
<mybatis-plus.version>3.5.6</mybatis-plus.version>
|
||||||
<h2.version>2.2.220</h2.version>
|
<h2.version>2.2.220</h2.version>
|
||||||
<knife4j.version>4.4.0</knife4j.version>
|
<knife4j.version>4.4.0</knife4j.version>
|
||||||
<calcite-core.version>1.35.13</calcite-core.version>
|
<calcite-core.version>1.35.14</calcite-core.version>
|
||||||
<commons-dbcp2.version>2.6.0</commons-dbcp2.version>
|
<commons-dbcp2.version>2.6.0</commons-dbcp2.version>
|
||||||
<antlr.version>3.5.2</antlr.version>
|
<antlr.version>3.5.2</antlr.version>
|
||||||
<java-jwt.version>3.12.1</java-jwt.version>
|
<java-jwt.version>3.12.1</java-jwt.version>
|
||||||
|
|||||||
@ -14,10 +14,10 @@ public class DatasourceDTO implements Serializable {
|
|||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1175287571828910222L;
|
private static final long serialVersionUID = 1175287571828910222L;
|
||||||
|
|
||||||
@JsonSerialize(using= ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@JsonSerialize(using= ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long pid;
|
private Long pid;
|
||||||
/**
|
/**
|
||||||
* 数据源名称
|
* 数据源名称
|
||||||
@ -73,10 +73,10 @@ public class DatasourceDTO implements Serializable {
|
|||||||
private TaskDTO syncSetting;
|
private TaskDTO syncSetting;
|
||||||
|
|
||||||
private Integer editType;
|
private Integer editType;
|
||||||
private String nodeType;
|
private String nodeType;
|
||||||
private String action;
|
private String action;
|
||||||
private String fileName;
|
private String fileName;
|
||||||
private String size;
|
private String size;
|
||||||
/**
|
/**
|
||||||
* 上次成功更新时间
|
* 上次成功更新时间
|
||||||
*/
|
*/
|
||||||
@ -91,4 +91,6 @@ public class DatasourceDTO implements Serializable {
|
|||||||
private String taskStatus;
|
private String taskStatus;
|
||||||
|
|
||||||
private Boolean enableDataFill;
|
private Boolean enableDataFill;
|
||||||
|
|
||||||
|
private int dsVersion = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,6 +136,10 @@ public abstract class Provider {
|
|||||||
try {
|
try {
|
||||||
DatasourceSchemaDTO value = dsMap.entrySet().iterator().next().getValue();
|
DatasourceSchemaDTO value = dsMap.entrySet().iterator().next().getValue();
|
||||||
|
|
||||||
|
// 获取数据库version
|
||||||
|
ConnectionObj connection = getConnection(value);
|
||||||
|
value.setDsVersion(connection.getConnection().getMetaData().getDatabaseMajorVersion());
|
||||||
|
|
||||||
SqlParser parser = SqlParser.create(sql, SqlParser.Config.DEFAULT.withLex(Lex.JAVA));
|
SqlParser parser = SqlParser.create(sql, SqlParser.Config.DEFAULT.withLex(Lex.JAVA));
|
||||||
SqlNode sqlNode = parser.parseStmt();
|
SqlNode sqlNode = parser.parseStmt();
|
||||||
return sqlNode.toSqlString(getDialect(value)).toString();
|
return sqlNode.toSqlString(getDialect(value)).toString();
|
||||||
@ -218,7 +222,7 @@ public abstract class Provider {
|
|||||||
sqlDialect = RedshiftSqlDialect.DEFAULT;
|
sqlDialect = RedshiftSqlDialect.DEFAULT;
|
||||||
break;
|
break;
|
||||||
case ck:
|
case ck:
|
||||||
sqlDialect = ClickHouseSqlDialect.DEFAULT;
|
sqlDialect = new ClickHouseSqlDialect(ClickHouseSqlDialect.DEFAULT_CONTEXT, coreDatasource.getDsVersion());
|
||||||
break;
|
break;
|
||||||
case h2:
|
case h2:
|
||||||
sqlDialect = H2SqlDialect.DEFAULT;
|
sqlDialect = H2SqlDialect.DEFAULT;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user