Skip to content

Commit

Permalink
[Fix][Connector] Fix When SqlServer executes a job, the generated tab…
Browse files Browse the repository at this point in the history
…le name does not include a schema. (#303)
  • Loading branch information
xxzuo authored Dec 5, 2023
1 parent 2bbc315 commit 71a26ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ default DataType getDataType(String jdbcType) {
}

default String quoteIdentifier(String entity) {
return "`" + entity + "`";
return entity;
}

default String getTableExistsQuery(String table) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ public boolean invalidateItemCanOutputToSelf() {
public boolean supportToBeErrorDataStorage() {
return true;
}

@Override
public String quoteIdentifier(String entity) {
return "`" + entity + "`";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@ public boolean invalidateItemCanOutputToSelf() {
public boolean supportToBeErrorDataStorage() {
return true;
}

@Override
public String quoteIdentifier(String entity) {
return entity;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ protected List<SourceConfig> getSourceConfigs() throws DataVinesException {
metricInputParameter.put(DATABASE_NAME,metricInputParameter.get(DATABASE));
metricInputParameter.put(TABLE_NAME,metricInputParameter.get(TABLE));
metricInputParameter.put(COLUMN_NAME,metricInputParameter.get(COLUMN));

if (connectorParameter.getParameters().get(SCHEMA) != null) {
metricInputParameter.put(SCHEMA, (String)connectorParameter.getParameters().get(SCHEMA));
}
String table = connectorFactory.getDialect()
.getFullQualifiedTableName(metricInputParameter.get(DATABASE),metricInputParameter.get(SCHEMA),metricInputParameter.get(TABLE));
connectorParameterMap.put(TABLE, table);
Expand All @@ -90,9 +92,6 @@ protected List<SourceConfig> getSourceConfigs() throws DataVinesException {
metricInputParameter.putAll(connectorFactory.getDialect().getDialectKeyMap());
metricInputParameter.put(SRC_CONNECTOR_TYPE, connectorParameter.getType());
metricInputParameter.put(TABLE, table);
if (connectorParameter.getParameters().get(SCHEMA) != null) {
metricInputParameter.put(SCHEMA, (String)connectorParameter.getParameters().get(SCHEMA));
}

boolean invalidateItemCanOutput = Boolean.parseBoolean(metricInputParameter.get(INVALIDATE_ITEM_CAN_OUTPUT));
invalidateItemCanOutput &= connectorFactory.getDialect().invalidateItemCanOutput();
Expand Down

0 comments on commit 71a26ef

Please sign in to comment.