Skip to content

Commit 8de9fb7

Browse files
committed
Duplicate the second part of the helper
1 parent 268e7ca commit 8de9fb7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

dumper/app/src/main/java/com/google/edwmigration/dumper/application/dumper/connector/snowflake/SnowflakeMetadataConnector.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,19 +322,24 @@ private Task<?> taskForAssessment(AssessmentQuery item, ConnectorArguments argum
322322
item.needsOverride
323323
? getOverrideableQuery(arguments, item.formatString, TABLE_STORAGE_METRICS)
324324
: item.formatString;
325-
String whereCondition;
326325
// Check whether the overrides changed anything.
327326
if (formatString.equals(item.formatString)) {
328327
// Overrides either not applied or equal to default values.
329-
whereCondition =
328+
String whereCondition =
330329
" WHERE deleted = FALSE AND schema_dropped IS NULL AND table_dropped IS NULL";
330+
// The condition is always passed to String.format. SHOW queries simply ignore it.
331+
String query = String.format(formatString, ACCOUNT_USAGE_SCHEMA_NAME, whereCondition);
332+
return new JdbcSelectTask(
333+
item.zipEntryName, query, TaskCategory.REQUIRED, TaskOptions.DEFAULT)
334+
.withHeaderTransformer(item.transformer());
331335
} else {
332-
whereCondition = "";
336+
String whereCondition = "";
337+
// The condition is always passed to String.format. SHOW queries simply ignore it.
338+
String query = String.format(formatString, ACCOUNT_USAGE_SCHEMA_NAME, whereCondition);
339+
return new JdbcSelectTask(
340+
item.zipEntryName, query, TaskCategory.REQUIRED, TaskOptions.DEFAULT)
341+
.withHeaderTransformer(item.transformer());
333342
}
334-
// The condition is always passed to String.format. SHOW queries simply ignore it.
335-
String query = String.format(formatString, ACCOUNT_USAGE_SCHEMA_NAME, whereCondition);
336-
return new JdbcSelectTask(item.zipEntryName, query, TaskCategory.REQUIRED, TaskOptions.DEFAULT)
337-
.withHeaderTransformer(item.transformer());
338343
}
339344

340345
private void addAssessmentQuery(

0 commit comments

Comments
 (0)