Skip to content

Commit

Permalink
CADC-13452 add api_created=true to tables created with TableIngester
Browse files Browse the repository at this point in the history
  • Loading branch information
jburke-cadc committed Sep 13, 2024
1 parent 7234013 commit 5538de4
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,10 @@ public void ingest(String schemaName, String tableName) {
try {
tm.startTransaction();

// TODO: change getSchema() above to lockSchema() once implemented to prevent duplicate put
// add the schema to the tap_schema if it doesn't exist
SchemaDesc schemaDesc = tapSchemaDAO.getSchema(schemaName, true);
if (schemaDesc == null) {
schemaDesc = new SchemaDesc(schemaName);
schemaDesc.tapPermissions = tapPermissions;
tapSchemaDAO.put(schemaDesc);
log.debug(String.format("added schema '%s' to tap_schema", schemaDesc.getSchemaName()));
} else {
if (schemaDesc != null) {
log.debug(String.format("existing schema '%s' in tap_schema", schemaDesc.getSchemaName()));
}

Expand Down Expand Up @@ -203,6 +199,7 @@ protected TableDesc createTableDesc(String schemaName, String tableName)
// build TableDesc
TableDesc tableDesc = new TableDesc(schemaName, tableName);
tableDesc.tableType = TableDesc.TableType.TABLE;
tableDesc.apiCreated = true;
log.debug(String.format("creating TableDesc %s %s", schemaName, tableName));
while (columnInfo.next()) {
String columnName = columnInfo.getString("COLUMN_NAME");
Expand Down

0 comments on commit 5538de4

Please sign in to comment.