Fix #4739: Connection Arguments with inner dicts (#4742)

This commit is contained in:
Sriharsha Chintalapani 2022-05-05 09:54:44 -07:00 committed by GitHub
parent ba33d0b3d6
commit b0a744507f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -8,16 +8,16 @@
"javaType": "org.openmetadata.catalog.services.connections.database.ConnectionOptions", "javaType": "org.openmetadata.catalog.services.connections.database.ConnectionOptions",
"description": "Additional connection options that can be sent to service during the connection.", "description": "Additional connection options that can be sent to service during the connection.",
"type": "object", "type": "object",
"additionalProperties": { "patternProperties": {
"type": "string" ".{1,}": { "type": "string" }
} }
}, },
"connectionArguments": { "connectionArguments": {
"javaType": "org.openmetadata.catalog.services.connections.database.ConnectionArguments", "javaType": "org.openmetadata.catalog.services.connections.database.ConnectionArguments",
"description": "Additional connection arguments such as security or protocol configs that can be sent to service during connection.", "description": "Additional connection arguments such as security or protocol configs that can be sent to service during connection.",
"type": "object", "type": "object",
"additionalProperties": { "patternProperties": {
"type": "string" ".{1,}": { "type": "string" }
} }
}, },
"supportsMetadataExtraction": { "supportsMetadataExtraction": {

View File

@ -492,10 +492,14 @@ public class IngestionPipelineResourceTest extends EntityResourceTest<IngestionP
DatabaseService databaseService = DatabaseService databaseService =
Entity.getEntity(ingestionPipeline.getService(), Fields.EMPTY_FIELDS, Include.ALL); Entity.getEntity(ingestionPipeline.getService(), Fields.EMPTY_FIELDS, Include.ALL);
DatabaseConnection databaseConnection = databaseService.getConnection(); DatabaseConnection databaseConnection = databaseService.getConnection();
Map<String, String> advConfig = new HashMap<>();
advConfig.put("hive.execution.engine", "tez");
advConfig.put("tez.queue.name", "tez");
ConnectionArguments connectionArguments = ConnectionArguments connectionArguments =
new ConnectionArguments() new ConnectionArguments()
.withAdditionalProperty("credentials", "/tmp/creds.json") .withAdditionalProperty("credentials", "/tmp/creds.json")
.withAdditionalProperty("client_email", "ingestion-bot@domain.com"); .withAdditionalProperty("client_email", "ingestion-bot@domain.com")
.withAdditionalProperty("configuration", advConfig);
ConnectionOptions connectionOptions = ConnectionOptions connectionOptions =
new ConnectionOptions().withAdditionalProperty("key1", "value1").withAdditionalProperty("key2", "value2"); new ConnectionOptions().withAdditionalProperty("key1", "value1").withAdditionalProperty("key2", "value2");
BigQueryConnection bigQueryConnection = BigQueryConnection bigQueryConnection =