[metastore] Use analysis from the DataCatalog in the table browser
@@ -446,22 +446,18 @@ var MetastoreTable = (function () {
self.fetchDetails = function () {
self.loadingDetails(true);
- // TODO: Move to DataCatalogEntry
- self.apiHelper.fetchTableDetails({
- sourceType: self.catalogEntry.getSourceType(),
- databaseName: self.database.catalogEntry.name,
- tableName: self.catalogEntry.name,
- successCallback: function (data) {
+ // TODO: Load in parallel
+ self.catalogEntry.getAnalysis().done(function (analysis) {
self.loadingDetails(false);
- if ((typeof data === 'object') && (data !== null)) {
- self.tableDetails(data);
- self.tableStats(data.details.stats);
+ if ((typeof analysis === 'object') && (analysis !== null)) {
+ self.tableDetails(analysis);
+ self.tableStats(analysis.details.stats);
self.refreshingTableStats(false);
self.samples.load();
self.loaded(true);
self.loading(false);
- if (data.partition_keys.length) {
- self.partitions.detailedKeys(data.partition_keys);
+ if (analysis.partition_keys.length) {
+ self.partitions.detailedKeys(analysis.partition_keys);
self.partitions.load();
} else {
self.partitions.loading(false);
@@ -469,23 +465,6 @@ var MetastoreTable = (function () {
}
self.catalogEntry.getComment().done(self.comment);
- // TODO: Verify that Nav stuff is loaded from parent
- // if (self.navigatorEnabled) {
- // $.get('/metadata/api/navigator/find_entity', {
- // type: 'table',
- // database: self.database.name,
- // name: self.name
- // }, function(data) {
- // if (data && data.status == 0) {
- // self.navigatorMeta(ko.mapping.fromJS(data.entity));
- // //self.getRelationships(); // Off for now
- // } else {
- // //$(document).trigger("info", data.message);
- // }
- // }).fail(function (xhr, textStatus, errorThrown) {
- // $(document).trigger("error", xhr.responseText);
- // });
- // }
// TODO: Move to DataCatalogEntry
if (self.optimizerEnabled) {
@@ -523,13 +502,12 @@ var MetastoreTable = (function () {
self.refreshingTableStats(false);
self.loading(false);
}
- },
- errorCallback: function (data) {
+ }).fail(function () {
self.refreshingTableStats(false);
- self.loadingDetails(false);
self.loading(false);
- }
- })
+ }).always(function () {
+ self.loadingDetails(false)
+ });
};
self.drop = function () {
