-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maciej Obuchowski <maciej.obuchowski@getindata.com>
- Loading branch information
1 parent
9e41452
commit da0ed70
Showing
21 changed files
with
469 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package marquez.db; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import marquez.common.models.NamespaceName; | ||
import marquez.common.models.OwnerName; | ||
import marquez.jdbi.MarquezJdbiExternalPostgresExtension; | ||
import marquez.service.models.NamespaceMeta; | ||
import org.jdbi.v3.core.Jdbi; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
|
||
@ExtendWith(MarquezJdbiExternalPostgresExtension.class) | ||
public class NamespaceDaoTest { | ||
|
||
private static NamespaceDao namespaceDao; | ||
|
||
@BeforeAll | ||
public static void setUpOnce(Jdbi jdbi) { | ||
namespaceDao = jdbi.onDemand(NamespaceDao.class); | ||
} | ||
|
||
@Test | ||
void testWriteAndReadNamespace() { | ||
var namespaceName = NamespaceName.of("postgres://localhost:5432"); | ||
var namespaceMeta = new NamespaceMeta(new OwnerName("marquez"), null); | ||
namespaceDao.upsertNamespaceMeta(namespaceName, namespaceMeta); | ||
|
||
assertTrue(namespaceDao.exists(namespaceName.getValue())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
172 changes: 172 additions & 0 deletions
172
api/src/test/resources/open_lineage/event_namespace_naming.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{ | ||
"eventType": "COMPLETE", | ||
"eventTime": "2020-12-28T19:51:01.641Z", | ||
"run": { | ||
"runId": "ea041791-68bc-4ae1-bd89-4c8106a157e4", | ||
"facets": { | ||
"nominalTime": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"nominalStartTime": "2020-12-17T03:00:00.001Z", | ||
"nominalEndTime": "2020-12-17T04:00:00.001Z" | ||
}, | ||
"parent": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"run": { | ||
"runId": "3f5e83fa-3480-44ff-99c5-ff943904e5e8" | ||
}, | ||
"job": { | ||
"namespace": "my-scheduler-namespace", | ||
"name": "myjob.mytask" | ||
} | ||
}, | ||
"additionalProp1": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp2": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp3": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
} | ||
} | ||
}, | ||
"job": { | ||
"namespace": "my-scheduler-namespace", | ||
"name": "myjob.mytask", | ||
"facets": { | ||
"documentation": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"description": "string" | ||
}, | ||
"sourceCodeLocation": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"type": "git", | ||
"url": "http://example.com" | ||
}, | ||
"sql": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalPropExample": { | ||
"example": true | ||
}, | ||
"query": "SELECT * FROM foo" | ||
}, | ||
"additionalProp1": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp2": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp3": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
} | ||
} | ||
}, | ||
"inputs": [ | ||
{ | ||
"namespace": "s3://blob-source", | ||
"name": "instance.schema.table", | ||
"facets": { | ||
"documentation": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"description": "canonical representation of entity Foo" | ||
}, | ||
"schema": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"fields": [ | ||
{ | ||
"name": "column1", | ||
"type": "VARCHAR", | ||
"description": "string" | ||
} | ||
] | ||
}, | ||
"dataSource": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"name": "s3://blob-source", | ||
"uri": "s3://blob-source" | ||
}, | ||
"additionalProp1": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp2": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp3": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
} | ||
} | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"namespace": "s3://blob-sink", | ||
"name": "instance.schema.table", | ||
"facets": { | ||
"documentation": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"description": "canonical representation of entity Foo" | ||
}, | ||
"schema": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"fields": [ | ||
{ | ||
"name": "column1", | ||
"type": "VARCHAR", | ||
"description": "string" | ||
} | ||
] | ||
}, | ||
"dataSource": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"name": "s3://blob-sink", | ||
"uri": "s3://blob-sink" | ||
}, | ||
"additionalProp1": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp2": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
}, | ||
"additionalProp3": { | ||
"_producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client", | ||
"_schemaURL": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/spec/OpenLineage.yml#MyCustomJobFacet", | ||
"additionalProp1": {} | ||
} | ||
} | ||
} | ||
], | ||
"producer": "https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.