Browse Source

[metastore] Fix column comment and clear the column cache on change

Johan Ahlen 10 năm trước cách đây
mục cha
commit
a3ea5293a2
1 tập tin đã thay đổi với 11 bổ sung13 xóa
  1. 11 13
      apps/metastore/src/metastore/templates/metastore.mako

+ 11 - 13
apps/metastore/src/metastore/templates/metastore.mako

@@ -1061,19 +1061,17 @@ ${ assist.assistPanel() }
       self.favourite = ko.observable(false);
 
       self.comment.subscribe(function (newValue) {
-        // TODO: Switch to using the ko observables in the url (self.table.name() and self.table.database.name();
-        ##         $.post("${ url('metastore:alter_column', database=database, table=table.name) }", {
-        ##           column: self.name(),
-        ##           comment: newValue
-        ##         }, function () {
-        ##           self.vm.assistHelper.clearCache({
-        ##             sourceType: 'hive',
-        ##             databaseName: self.table.database.name,
-        ##             tableName: self.table.name,
-        ##             fields: []
-        ##           })
-        ##         });
-              })
+        $.post('/metastore/table/' + self.table.database.name + '/' + self.table.name + '/alter_column', {
+          column: self.name(),
+          comment: newValue
+        }, function () {
+          self.table.assistHelper.clearCache({
+            sourceType: 'hive',
+            databaseName: self.table.database.name,
+            tableName: self.table.name
+          })
+        });
+      })
     }
 
     /**