Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate handling of different catalog names, but same schema name in both catalogs #901

Open
npetzall opened this issue Jun 6, 2022 · 0 comments

Comments

@npetzall
Copy link
Member

npetzall commented Jun 6, 2022

When doing multi analysis it writes each schema to a directory named by the schema:

File outputDirForSchema = new File(outputDir, new FileNameGenerator().generate(schema));
db = this.analyze(schema, config, outputDirForSchema, databaseService, progressListener);

When linking in DotNode the method Table.getContainer() is used:

private String createPath(boolean fromRoot) {
if (dotConfig.useRelativeLinks()) {
return (table.isRemote() ? "../../../" + new FileNameGenerator().generate(table.getContainer()) : "../..") + TABLES_PATH;
}
if (fromRoot) {
return (table.isRemote() ? ("../" + new FileNameGenerator().generate(table.getContainer()) + TABLES_PATH) : "tables/");
}
return (table.isRemote() ? ("../../" + new FileNameGenerator().generate(table.getContainer()) + TABLES_PATH) : "");
}

This logic isn't identical to the creation of the directory structure.

this.container = Optional.ofNullable(schema).orElse(Optional.ofNullable(catalog).orElse(db.getName()));

This works since it checks the schema first, and there is a restriction that schema must exist when analyzing.

But there might exist an issue with MSSQLServer, since I believe that you can have two catalogs that both contain schemas with the same name.

catA.schemaA and catB.schemaB, same thing might exist for pgsql.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant