Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ public final void addTasksTo(
isAssessment,
getInformationSchemaWhereCondition("function_catalog", arguments.getDatabases()));

String featuresQuery =
"SELECT 'STORAGE', 'DYNAMIC_TABLES', COUNT(*), 'TABLES' FROM"
+ " SNOWFLAKE.ACCOUNT_USAGE.TABLES WHERE IS_DYNAMIC = 'YES'";

out.add(
new JdbcSelectTask(
FeaturesFormat.IS_ZIP_ENTRY_NAME,
featuresQuery,
TaskCategory.OPTIONAL, // TODO: Change to REQUIRED after implementation is finished
TaskOptions.DEFAULT)
.withHeaderClass(FeaturesFormat.Header.class));

if (isAssessment) {
for (AssessmentQuery item : planner.generateAssessmentQueries()) {
String query = queryForAssessment(item, arguments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ views.csv: "SELECT table_catalog, table_schema, table_name, view_definition FROM
functions-au.csv: "SELECT function_schema, function_name, data_type, argument_signature FROM SNOWFLAKE.ACCOUNT_USAGE.FUNCTIONS WHERE DELETED IS NULL"
functions.csv: "SELECT function_schema, function_name, data_type, argument_signature FROM INFORMATION_SCHEMA.FUNCTIONS"
external_tables.csv: "SHOW EXTERNAL TABLES"
features.csv: "SELECT 'STORAGE', 'DYNAMIC_TABLES', COUNT(*), 'TABLES' FROM SNOWFLAKE.ACCOUNT_USAGE.TABLES WHERE IS_DYNAMIC = 'YES'"
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,16 @@ enum Header {
OwnerRoleType
}
}

interface FeaturesFormat {

String IS_ZIP_ENTRY_NAME = "features.csv";

enum Header {
FeatureType,
FeatureName,
Count,
Description
}
}
}