From 6e2160953902ce58608e8595d7937abfb9d43d8e Mon Sep 17 00:00:00 2001 From: Drew Banin Date: Wed, 8 May 2019 20:42:11 -0400 Subject: [PATCH] (fixes #17) by formatting stats better on bq/snowflake --- src/app/components/table_details/table_details.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/components/table_details/table_details.js b/src/app/components/table_details/table_details.js index a78e3b4d3..e340615d3 100644 --- a/src/app/components/table_details/table_details.js +++ b/src/app/components/table_details/table_details.js @@ -34,7 +34,7 @@ angular } if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; if (typeof precision === 'undefined') precision = 0; - var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], + var units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'], number = Math.floor(Math.log(bytes) / Math.log(1024)); return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; } @@ -95,11 +95,16 @@ angular } function getExtendedStats(stats) { + // TODO : This logic should be pushed into dbt's catalog generation var format = { - rows: asNumber, + rows: asNumber, // Redshift + row_count: asNumber, // Snowflake + num_rows: asNumber, // BigQuery max_varchar: asNumber, pct_used: asPercent, - size: asBytes, + size: asBytes, // Redshift + bytes: asBytes, // Snowflake + num_bytes: asBytes, // BigQuery } var sorted_stats = _.sortBy(_.values(stats), 'label');