@finos/legend-data-cube
Version:
49 lines • 1.92 kB
JavaScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DataCubeQueryAggregateOperation } from './DataCubeQueryAggregateOperation.js';
import { DataCubeQueryAggregateOperator, DataCubeColumnDataType, DataCubeFunction, ofDataType, } from '../DataCubeQueryEngine.js';
import { _aggCol_base } from '../DataCubeQueryBuilderUtils.js';
import { _agg_base } from '../DataCubeSnapshotBuilderUtils.js';
export class DataCubeQueryAggregateOperation__Average extends DataCubeQueryAggregateOperation {
get label() {
return 'avg';
}
get textLabel() {
return 'average';
}
get description() {
return 'average';
}
get operator() {
return DataCubeQueryAggregateOperator.AVERAGE;
}
isCompatibleWithColumn(column) {
return ofDataType(column.type, [DataCubeColumnDataType.NUMBER]);
}
isCompatibleWithParameterValues(values) {
return !values.length;
}
generateDefaultParameterValues(column) {
return [];
}
buildAggregateColumnSnapshot(colSpec, columnGetter) {
return this._finalizeAggregateColumnSnapshot(_agg_base(colSpec, DataCubeFunction.AVERAGE, columnGetter));
}
buildAggregateColumnExpression(column) {
return _aggCol_base(column, DataCubeFunction.AVERAGE);
}
}
//# sourceMappingURL=DataCubeQueryAggregateOperation__Average.js.map