mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-14 09:05:58 +00:00
Minor fix: Relevant fields are pulled for bulk import (#22154)
Co-authored-by: Ashish Gupta <ashish@getcollate.io>
This commit is contained in:
parent
0b2321e976
commit
85b7328e95
@ -1047,7 +1047,9 @@ public abstract class EntityCsv<T extends EntityInterface> {
|
|||||||
|
|
||||||
Database database;
|
Database database;
|
||||||
try {
|
try {
|
||||||
database = Entity.getEntityByName(DATABASE, dbFQN, "*", Include.NON_DELETED);
|
database =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
DATABASE, dbFQN, "name,displayName,fullyQualifiedName,service", Include.NON_DELETED);
|
||||||
} catch (EntityNotFoundException ex) {
|
} catch (EntityNotFoundException ex) {
|
||||||
LOG.warn("Database not found: {}. Handling based on dryRun mode.", dbFQN);
|
LOG.warn("Database not found: {}. Handling based on dryRun mode.", dbFQN);
|
||||||
if (importResult.getDryRun()) {
|
if (importResult.getDryRun()) {
|
||||||
@ -1063,7 +1065,12 @@ public abstract class EntityCsv<T extends EntityInterface> {
|
|||||||
(DatabaseSchemaRepository) Entity.getEntityRepository(DATABASE_SCHEMA);
|
(DatabaseSchemaRepository) Entity.getEntityRepository(DATABASE_SCHEMA);
|
||||||
String schemaFqn = FullyQualifiedName.add(dbFQN, csvRecord.get(0));
|
String schemaFqn = FullyQualifiedName.add(dbFQN, csvRecord.get(0));
|
||||||
try {
|
try {
|
||||||
schema = Entity.getEntityByName(DATABASE_SCHEMA, schemaFqn, "*", Include.NON_DELETED);
|
schema =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
DATABASE_SCHEMA,
|
||||||
|
schemaFqn,
|
||||||
|
"name,displayName,fullyQualifiedName",
|
||||||
|
Include.NON_DELETED);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOG.warn("Database Schema not found: {}, it will be created with Import.", schemaFqn);
|
LOG.warn("Database Schema not found: {}, it will be created with Import.", schemaFqn);
|
||||||
schema =
|
schema =
|
||||||
@ -1117,7 +1124,9 @@ public abstract class EntityCsv<T extends EntityInterface> {
|
|||||||
// Fetch Schema Entity
|
// Fetch Schema Entity
|
||||||
DatabaseSchema schema;
|
DatabaseSchema schema;
|
||||||
try {
|
try {
|
||||||
schema = Entity.getEntityByName(DATABASE_SCHEMA, schemaFQN, "*", Include.NON_DELETED);
|
schema =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
DATABASE_SCHEMA, schemaFQN, "name,displayName,service,database", Include.NON_DELETED);
|
||||||
} catch (EntityNotFoundException ex) {
|
} catch (EntityNotFoundException ex) {
|
||||||
LOG.warn("Schema not found: {}. Handling based on dryRun mode.", schemaFQN);
|
LOG.warn("Schema not found: {}. Handling based on dryRun mode.", schemaFQN);
|
||||||
if (importResult.getDryRun()) {
|
if (importResult.getDryRun()) {
|
||||||
@ -1138,7 +1147,9 @@ public abstract class EntityCsv<T extends EntityInterface> {
|
|||||||
Table table;
|
Table table;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
table = Entity.getEntityByName(TABLE, tableFqn, "*", Include.NON_DELETED);
|
table =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
TABLE, tableFqn, "name,displayName,fullyQualifiedName,columns", Include.NON_DELETED);
|
||||||
} catch (EntityNotFoundException ex) {
|
} catch (EntityNotFoundException ex) {
|
||||||
// Table not found, create a new one
|
// Table not found, create a new one
|
||||||
|
|
||||||
@ -1202,7 +1213,9 @@ public abstract class EntityCsv<T extends EntityInterface> {
|
|||||||
DatabaseSchema schema;
|
DatabaseSchema schema;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
schema = Entity.getEntityByName(DATABASE_SCHEMA, schemaFQN, "*", Include.NON_DELETED);
|
schema =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
DATABASE_SCHEMA, schemaFQN, "name,displayName,service,database", Include.NON_DELETED);
|
||||||
} catch (EntityNotFoundException ex) {
|
} catch (EntityNotFoundException ex) {
|
||||||
LOG.warn("Schema not found: {}. Handling based on dryRun mode.", schemaFQN);
|
LOG.warn("Schema not found: {}. Handling based on dryRun mode.", schemaFQN);
|
||||||
if (importResult.getDryRun()) {
|
if (importResult.getDryRun()) {
|
||||||
@ -1219,7 +1232,12 @@ public abstract class EntityCsv<T extends EntityInterface> {
|
|||||||
|
|
||||||
StoredProcedure sp;
|
StoredProcedure sp;
|
||||||
try {
|
try {
|
||||||
sp = Entity.getEntityByName(STORED_PROCEDURE, entityFQN, "*", Include.NON_DELETED);
|
sp =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
STORED_PROCEDURE,
|
||||||
|
entityFQN,
|
||||||
|
"name,displayName,fullyQualifiedName",
|
||||||
|
Include.NON_DELETED);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOG.warn("Stored procedure not found: {}, it will be created with Import.", entityFQN);
|
LOG.warn("Stored procedure not found: {}, it will be created with Import.", entityFQN);
|
||||||
sp =
|
sp =
|
||||||
@ -1282,10 +1300,17 @@ public abstract class EntityCsv<T extends EntityInterface> {
|
|||||||
Table table;
|
Table table;
|
||||||
DatabaseSchema schema;
|
DatabaseSchema schema;
|
||||||
try {
|
try {
|
||||||
table = Entity.getEntityByName(TABLE, tableFQN, "*", Include.NON_DELETED);
|
table =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
TABLE, tableFQN, "name,displayName,fullyQualifiedName,columns", Include.NON_DELETED);
|
||||||
} catch (EntityNotFoundException ex) {
|
} catch (EntityNotFoundException ex) {
|
||||||
try {
|
try {
|
||||||
schema = Entity.getEntityByName(DATABASE_SCHEMA, schemaFQN, "*", Include.NON_DELETED);
|
schema =
|
||||||
|
Entity.getEntityByName(
|
||||||
|
DATABASE_SCHEMA,
|
||||||
|
schemaFQN,
|
||||||
|
"name,displayName,service,database",
|
||||||
|
Include.NON_DELETED);
|
||||||
} catch (EntityNotFoundException exception) {
|
} catch (EntityNotFoundException exception) {
|
||||||
LOG.warn("Schema not found: {}. Handling based on dryRun mode.", schemaFQN);
|
LOG.warn("Schema not found: {}. Handling based on dryRun mode.", schemaFQN);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user