public static string GetAggregateFuncationTag(AggregateFunctionType type) { switch (type) { case AggregateFunctionType.AVG: return(AVG); case AggregateFunctionType.COUNT: return(COUNT); case AggregateFunctionType.MAX: return(MAX); case AggregateFunctionType.MIN: return(MIN); case AggregateFunctionType.SUM: return(SUM); case AggregateFunctionType.FIRST: return(FIRST); case AggregateFunctionType.LAST: return(LAST); default: return(null); } }
internal void SetResult(QueryContext queryContext, AggregateFunctionType functionType, object result) { QueryResultSet resultSet = new QueryResultSet(); resultSet.Type = QueryType.AggregateFunction; resultSet.AggregateFunctionType = functionType; resultSet.AggregateFunctionResult = new DictionaryEntry(functionType, result); queryContext.ResultSet = resultSet; }
void ICompactSerializable.Deserialize(Runtime.Serialization.IO.CompactReader reader) { _aggregateFunctionResult = (DictionaryEntry)reader.ReadObject(); _searchKeysResult = reader.ReadObject() as ArrayList; _searchEntriesResult = reader.ReadObject() as Hashtable; _queryType = (QueryType)reader.ReadInt32(); _aggregateFunctionType = (AggregateFunctionType)reader.ReadInt32(); }
internal void SetResult(QueryContext queryContext, AggregateFunctionType functionType, object result) { QueryResultSet resultSet = new QueryResultSet(); resultSet.Type = QueryType.AggregateFunction; resultSet.AggregateFunctionType = functionType; resultSet.AggregateFunctionResult = new DictionaryEntry(functionType, result); queryContext.ResultSet = resultSet; }
/// <summary> /// Deserializa os dados na instancia. /// </summary> /// <param name="reader"></param> public virtual void Deserialize(CompactReader reader) { _aggregateFunctionResult = (DictionaryEntry)reader.ReadObject(); _searchKeysResult = reader.ReadObject() as ArrayList; _searchEntriesResult = reader.ReadObject() as Hashtable; _queryType = (QueryType)reader.ReadInt32(); _aggregateFunctionType = (AggregateFunctionType)reader.ReadInt32(); _cqId = reader.ReadString(); }
public void Deserialize(Runtime.Serialization.IO.CompactReader reader) { _columnName = reader.ReadObject() as string; _columnType = (ColumnType)reader.ReadInt32(); _dataType = (ColumnDataType)reader.ReadInt32(); _aggregateFunctionType = (AggregateFunctionType)reader.ReadInt32(); _isFilled = reader.ReadBoolean(); _isHidden = reader.ReadBoolean(); }
void ICompactSerializable.Deserialize(Runtime.Serialization.IO.CompactReader reader) { _aggregateFunctionResult = (DictionaryEntry)reader.ReadObject(); _searchKeysResult = reader.ReadObject() as ClusteredArrayList; _searchEntriesResult = reader.ReadObject() as IDictionary; _queryType = (QueryType)reader.ReadInt32(); _aggregateFunctionType = (AggregateFunctionType)reader.ReadInt32(); _cqId = reader.ReadString(); _groupByFunctionResult = reader.ReadObject() as RecordSet; }
public AggregateFunction(AggregateFunctionType type, string condition) { if (!type.GetDisplayName().EndsWith("IF", StringComparison.OrdinalIgnoreCase)) { throw new IncorrectTgOptionsException( $"Cannot set condition property to {type.GetDisplayName()} function. " + "Function must end with 'If' string, such as SumIf, CcountIf"); } Type = type; Condition = condition; }
public static Identifier GetMethodName(AggregateFunctionType type) { switch (type) { case AggregateFunctionType.Avg: return Avg; case AggregateFunctionType.Max: return Max; case AggregateFunctionType.Min: return Min; case AggregateFunctionType.Sum: return Sum; case AggregateFunctionType.Count: return Count; } return null; }
public DocumentCollector AddAggregateFunction(AggregateFunctionType type, IEvaluable field) { if (_aggregations == null) { _aggregations = new List <DocumentCollector>(); } IAggregation function; switch (type) { case AggregateFunctionType.AVG: function = new AVG(); break; case AggregateFunctionType.COUNT: function = new COUNT(); break; case AggregateFunctionType.MAX: function = new MAX(); break; case AggregateFunctionType.MIN: function = new MIN(); break; case AggregateFunctionType.SUM: function = new SUM(); break; //case AggregateFunctionType.FIRST: // function = new FIRST(field); // break; //case AggregateFunctionType.LAST: // function = new LAST(field); // break; default: throw new QuerySystemException(ErrorCodes.Query.AGGREGATION_INVALID_FUNCTION); } var aggregator = new DocumentCollector(function, field); _aggregations.Add(aggregator); return(aggregator); }
public AggregateFunction(AggregateFunctionType aggregate_function_type, ISqlExpression expression) { _aggregateFunctionType = aggregate_function_type; _expression = expression; }
public Aggregate(AggregateFunctionType type, params Expression[] expression) : this(GetMethodName(type), expression) { }
/// <summary> /// Sets <see cref="Alachisoft.NosDB.Common.DataStructures.AggregateFunctionType"/> of specifeid column /// </summary> /// <param name="columnName">Name of column</param> /// <param name="type"><see cref="Alachisoft.NosDB.Common.DataStructures.AggregateFunctionType"/> to set</param> public void SetAggregateFunctionType(string columnName, AggregateFunctionType type) { _dataStringIndex[columnName].AggregateFunctionType = type; }
/// <summary> /// Adds a new column in <see cref="Alachisoft.NosDB.Common.DataStructures.Recordset"/> /// </summary> /// <param name="columnName">Name of column</param> /// <param name="isHidden">IsHidden property of column</param> /// <param name="columnType"></param> /// <param name="aggregateFunctionType"></param> /// <returns>fasle if column with same name already exists, true otherwise</returns> public bool AddColumn(string columnName, bool isHidden, ColumnType columnType, AggregateFunctionType aggregateFunctionType) { if (_dataStringIndex.ContainsKey(columnName)) { return(false); } RecordColumn column = new RecordColumn(columnName, isHidden); column.Type = columnType; column.AggregateFunctionType = aggregateFunctionType; _dataIntIndex[this.ColumnCount] = column; _dataStringIndex[columnName] = column; if (isHidden) { _hiddenColumnCount++; } return(true); }
/// <summary> /// Adds a new column in <see cref="Alachisoft.NosDB.Common.DataStructures.Recordset"/> /// </summary> /// <param name="columnName">Name of column</param> /// <param name="isHidden">IsHidden property of column</param> /// <param name="aggregateFunctionType"></param> /// <returns>fasle if column with same name already exists, true otherwise</returns> public bool AddColumn(string columnName, bool isHidden, AggregateFunctionType aggregateFunctionType) { return(this.AddColumn(columnName, isHidden, ColumnType.AttributeColumn, aggregateFunctionType)); }
public DecimalAggregator(AggregateFunctionType type) { this.aggregateType = type; }
private SelectStatement AggregateColumn(AggregateFunctionType aggregate_function_type, string column_name, string alias) { Columns.Add(new SelectColumn(new AggregateFunction(aggregate_function_type, column_name), alias)); return(this); }
public LongAggregator(AggregateFunctionType type) { this.aggregateType = type; }
public DoubleAggregator(AggregateFunctionType type) { this.aggregateType = type; }
public AggregateFunction(AggregateFunctionType type) { Type = type; }
public IntegerAggregator(AggregateFunctionType type) { this.aggregateType = type; }
public ShortAggregator(AggregateFunctionType type) { this.aggregateType = type; }
public AggregateFunction(AggregateFunctionType aggregate_function_type, string column_name) { _aggregateFunctionType = aggregate_function_type; _expression = new SqlColumnName(column_name); }
void ICompactSerializable.Deserialize(Runtime.Serialization.IO.CompactReader reader) { _aggregateFunctionResult = (DictionaryEntry)reader.ReadObject(); _searchKeysResult = reader.ReadObject() as ArrayList; _searchEntriesResult = reader.ReadObject() as Hashtable; _queryType = (QueryType)reader.ReadInt32(); _aggregateFunctionType = (AggregateFunctionType)reader.ReadInt32(); }
private SelectStatement AggregateColumn(AggregateFunctionType aggregate_function_type, ISqlExpression expression, string alias) { Columns.Add(new SelectColumn(new AggregateFunction(aggregate_function_type, expression), alias)); return(this); }