我有一个像这样的hadoop:
hadoop fs -ls /user/hive/warehouse/mashery_db.db/agg_per_mapi_stats_five_minutes/ | sort | awk '{ if (index($8, ".hive") == 0 && $6 <= "'"2016-02-10"'" && $7 <= "'"05:00"'") print $8 }'
我希望从中获取前10个值,而不是获取目录中的所有文件。
答案 0 :(得分:3)
在head -10
hadoop fs -ls /stuff | sort | awk whatever | head -10
答案 1 :(得分:3)
只需使用
var StudentListSystem = angular.module('StudentListSystem', ['ngRoute']);
StudentListSystem.controller('SectionFormController', function($scope, $http){
$scope.ajax_delete = function(id){
// alert(id);
$http.delete('http://127.0.0.1:8000/api/v1/section/'+id)
.then(function(response){
$scope.Notifications = true;
$scope.Deleted = response.data;
// alert(JSON.stringify(response));
$http.get('http://127.0.0.1:8000/api/v1/section/')
.then(function(response){
$scope.Sections = response.data;
});
}, function(response){
$scope.Notifications = true;
$scope.Errors = response.data;
});
}
$scope.ajax_update_button = function(event){
x = $(this).next().next().text();
$(this).next().next().html("<input type='text' value='"+x+"'>");
}
});
这将有效。