Created
January 6, 2020 07:16
-
-
Save garystafford/332604b4997b7ae2f20da174311e348b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
database=smart_hub_data_catalog | |
tables=(smart_hub_locations_parquet sensor_mappings_parquet smart_hub_data_parquet etl_output_parquet) | |
for table in ${tables}; do | |
fixed_table=$(aws glue get-table \ | |
--database-name "${database}" \ | |
--name "${table}" \ | |
| jq '.Table.Parameters.classification = "parquet" | del(.Table.DatabaseName) | del(.Table.CreateTime) | del(.Table.UpdateTime) | del(.Table.CreatedBy) | del(.Table.IsRegisteredWithLakeFormation)') | |
fixed_table=$(echo ${fixed_table} | jq .Table) | |
aws glue update-table \ | |
--database-name "${database}" \ | |
--table-input "${fixed_table}" | |
echo "table '${table}' classification changed to 'parquet'" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment