Skip to content

Commit b83def1

Browse files
fixing ups...
1 parent 6d8d00b commit b83def1

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

amazon-redshift-plugin/src/test/java/io/cdap/plugin/amazon/redshift/RedshiftFailedConnectionTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public class RedshiftFailedConnectionTest extends DBSpecificFailedConnectionTest
2828
public void test() throws ClassNotFoundException, IOException {
2929

3030
RedshiftConnector connector = new RedshiftConnector(
31-
new RedshiftConnectorConfig("username", "password", "jdbc", "", "localhost", "db", 5432));
31+
new RedshiftConnectorConfig("username", "password", "jdbc", "", "localhost", "db", 5432));
3232

3333
super.test(JDBC_DRIVER_CLASS_NAME, connector, "Failed to create connection to database via connection string: " +
34-
"jdbc:redshift://localhost:5432/db and arguments: " +
35-
"{user=username}. Error: ConnectException: Connection refused " +
36-
"(Connection refused).");
34+
"jdbc:redshift://localhost:5432/db and arguments: " +
35+
"{user=username}. Error: ConnectException: Connection refused " +
36+
"(Connection refused).");
3737
}
3838
}

database-commons/src/main/java/io/cdap/plugin/db/config/AbstractDBSpecificSourceConfig.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void validate(FailureCollector collector) {
148148
TransactionIsolationLevel.validate(getTransactionIsolationLevel(), collector);
149149
}
150150

151-
if (!containsMacro(PROPERTY_IMPORT_QUERY_TYPE)) {
151+
if (!containsMacro(PROPERTY_IMPORT_QUERY_TYPE)) {
152152
ImportQueryType importQueryType = ImportQueryType.fromString(getImportQueryType());
153153
boolean isImportQuery = importQueryType == ImportQueryType.IMPORT_QUERY;
154154

@@ -159,12 +159,11 @@ public void validate(FailureCollector collector) {
159159
}
160160
}
161161

162-
163-
if (!hasOneSplit && !containsMacro(IMPORT_QUERY) && !getImportQuery().contains("$CONDITIONS")) {
162+
if (!hasOneSplit && !containsMacro(IMPORT_QUERY) && !getImportQuery().contains("$CONDITIONS")) {
164163
collector.addFailure(String.format(
165164
"Import Query %s must contain the string '$CONDITIONS'. if Number of Splits is not set to 1.", importQuery),
166-
"Include '$CONDITIONS' in the Import Query")
167-
.withConfigProperty(IMPORT_QUERY);
165+
"Include '$CONDITIONS' in the Import Query")
166+
.withConfigProperty(IMPORT_QUERY);
168167
}
169168

170169
if (!hasOneSplit && !containsMacro(SPLIT_BY) && (splitBy == null || splitBy.isEmpty())) {
@@ -206,7 +205,7 @@ public void validateSchema(Schema actualSchema, FailureCollector collector) {
206205
Schema actualFieldSchema = actualField.getSchema().isNullable() ?
207206
actualField.getSchema().getNonNullable() : actualField.getSchema();
208207
Schema expectedFieldSchema = field.getSchema().isNullable() ?
209-
field.getSchema().getNonNullable() : field.getSchema();
208+
field.getSchema().getNonNullable() : field.getSchema();
210209

211210
validateField(collector, field, actualFieldSchema, expectedFieldSchema);
212211
}

postgresql-plugin/src/main/java/io/cdap/plugin/postgres/PostgresSchemaReader.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ public Schema getSchema(String typeName, int columnType, int precision, int scal
9595
return Schema.of(Schema.Type.STRING);
9696
}
9797
// If it is a numeric type without precision then use the Schema of String to avoid any precision loss
98-
if (Types.NUMERIC == columnType ||
99-
"numeric".equalsIgnoreCase(typeName) ||
100-
"decimal".equalsIgnoreCase(typeName)) {
98+
if (Types.NUMERIC == columnType) {
10199
if (precision == 0) {
102100
LOG.warn(String.format("Field '%s' is a %s type without precision and scale, "
103101
+ "converting into STRING type to avoid any precision loss.",

postgresql-plugin/src/test/java/io/cdap/plugin/postgres/PostgresFailedConnectionTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public class PostgresFailedConnectionTest extends DBSpecificFailedConnectionTest
2828
public void test() throws ClassNotFoundException, IOException {
2929

3030
PostgresConnector connector = new PostgresConnector(
31-
new PostgresConnectorConfig("localhost", 5432, "username", "password", "jdbc", ""));
31+
new PostgresConnectorConfig("localhost", 5432, "username", "password", "jdbc", ""));
3232

3333
super.test(JDBC_DRIVER_CLASS_NAME, connector, "Failed to create connection to database via connection string: " +
34-
"jdbc:postgresql://localhost:5432/null and arguments: " +
35-
"{user=username}. Error: ConnectException: Connection refused " +
36-
"(Connection refused).");
34+
"jdbc:postgresql://localhost:5432/null and arguments: " +
35+
"{user=username}. Error: ConnectException: Connection refused " +
36+
"(Connection refused).");
3737
}
3838
}

0 commit comments

Comments
 (0)