public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); var other = (ExprAggMultiFunctionLinearAccessNodeFactoryAccess)intoTableAgg; AggregationMethodFactoryUtil.ValidateEventType(_containedEventType, other.ContainedEventType); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactoryAvg) intoTableAgg; AggregationValidationUtil.ValidateAggregationInputType(ChildType, that.ChildType); AggregationValidationUtil.ValidateAggregationFilter(Parent.HasFilter, that.Parent.HasFilter); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactorySum) intoTableAgg; AggregationValidationUtil.ValidateAggregationInputType(_inputValueType, that._inputValueType); AggregationValidationUtil.ValidateAggregationFilter(_parent.HasFilter, that._parent.HasFilter); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (ExprPlugInAggMultiFunctionNodeFactory) intoTableAgg; if (!GetAggregationStateKey(false).Equals(that.GetAggregationStateKey(false))) throw new ExprValidationException("Mismatched state key"); }
public override void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { var use = (ExprAggCountMinSketchNodeFactoryUse)intoTableAgg; var aggType = use.Parent.AggType; if (aggType == CountMinSketchAggType.FREQ || aggType == CountMinSketchAggType.ADD) { Type clazz = use.AddOrFrequencyEvaluator.ReturnType; var foundMatch = false; foreach (var allowed in _stateFactory.Specification.Agent.AcceptableValueTypes) { if (TypeHelper.IsSubclassOrImplementsInterface(clazz, allowed)) { foundMatch = true; } } if (!foundMatch) { throw new ExprValidationException( "Mismatching parameter return type, expected any of " + _stateFactory.Specification.Agent.AcceptableValueTypes.Render() + " but received " + clazz.GetTypeNameFullyQualPretty()); } } }
public void TestAggregateFunction() { AggregationMethodFactory aggFactory = ValidatedNodeToTest.Factory; AggregationMethod agg = aggFactory.Make(SupportExprNodeFactory.MethodResService, -1, 1, 1); Assert.AreEqual(typeof(double?), agg.ValueType); Assert.IsNull(agg.Value); agg.Enter(82); Assert.AreEqual(0D, agg.Value); agg.Enter(78); Assert.AreEqual(2D, agg.Value); agg.Enter(70); double result = agg.Value.AsDouble(); Assert.AreEqual("4.4444", result.ToString().Substring(0, 6)); agg.Enter(58); Assert.AreEqual(8D, agg.Value); agg.Enter(42); Assert.AreEqual(12.8D, agg.Value); agg.Leave(82); Assert.AreEqual(12D, agg.Value); agg.Leave(58); result = agg.Value.AsDouble(); Assert.AreEqual("14.2222", result.ToString().Substring(0, 7)); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var other = (ExprAggMultiFunctionSortedMinMaxByNodeFactory) intoTableAgg; AggregationValidationUtil.ValidateEventType(ContainedEventType, other.ContainedEventType); AggregationValidationUtil.ValidateAggFuncName(Parent.AggregationFunctionName, other.Parent.AggregationFunctionName); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { service.AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); AggregationMethodFactoryFirstEver that = (AggregationMethodFactoryFirstEver)intoTableAgg; service.AggregationMethodFactoryUtil.ValidateAggregationInputType(ChildType, that.ChildType); service.AggregationMethodFactoryUtil.ValidateAggregationFilter(Parent.HasFilter, that.Parent.HasFilter); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { service.AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); AggregationMethodFactoryStddev that = (AggregationMethodFactoryStddev)intoTableAgg; service.AggregationMethodFactoryUtil.ValidateAggregationInputType(AggregatedValueType, that.AggregatedValueType); service.AggregationMethodFactoryUtil.ValidateAggregationFilter(Parent.HasFilter, that.Parent.HasFilter); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); ExprFirstEverNodeFactory that = (ExprFirstEverNodeFactory)intoTableAgg; AggregationMethodFactoryUtil.ValidateAggregationInputType(_childType, that._childType); AggregationMethodFactoryUtil.ValidateAggregationFilter(_parent.HasFilter, that._parent.HasFilter); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactoryRate) intoTableAgg; if (_intervalTime != that._intervalTime) throw new ExprValidationException("The size is " + _intervalTime + " and provided is " + that._intervalTime); AggregationValidationUtil.ValidateAggregationUnbound(!_isEver, !that._isEver); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactoryNth) intoTableAgg; AggregationValidationUtil.ValidateAggregationInputType(ResultType, that.ResultType); if (_size != that._size) throw new ExprValidationException( "The size is " + _size + " and provided is " + that._size); }
public TableMetadataColumnAggregation(string columnName, AggregationMethodFactory factory, int methodOffset, AggregationAccessorSlotPair accessAccessorSlotPair, EPType optionalEnumerationType, EventType optionalEventType) : base(columnName, false) { Factory = factory; MethodOffset = methodOffset; AccessAccessorSlotPair = accessAccessorSlotPair; OptionalEnumerationType = optionalEnumerationType; OptionalEventType = optionalEventType; }
public override ExprNode Validate(ExprValidationContext validationContext) { ValidatePositionals(); _aggregationMethodFactory = ValidateAggregationChild(validationContext); if (validationContext.ExprEvaluatorContext.StatementType == StatementType.CREATE_TABLE && _optionalAggregateLocalGroupByDesc != null) { throw new ExprValidationException("The 'group_by' parameter is not allowed in create-table statements"); } return(null); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactoryFirstLastUnbound) intoTableAgg; AggregationValidationUtil.ValidateStreamNumZero(that._streamNum); if (_collectionEventType != null) AggregationValidationUtil.ValidateEventType(_collectionEventType, that._collectionEventType); else AggregationValidationUtil.ValidateAggregationInputType(ResultType, that.ResultType); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { service.AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); AggregationMethodFactoryNth that = (AggregationMethodFactoryNth)intoTableAgg; service.AggregationMethodFactoryUtil.ValidateAggregationInputType(ChildType, that.ChildType); if (Size != that.Size) { throw new ExprValidationException(string.Format("The size is {0} and provided is {1}", Size, that.Size)); } }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactoryCountEver) intoTableAgg; if (that._ignoreNulls != _ignoreNulls) throw new ExprValidationException("The aggregation declares " + (_ignoreNulls ? "ignore-nulls" : "no-ignore-nulls") + " and provided is " + (that._ignoreNulls ? "ignore-nulls" : "no-ignore-nulls")); AggregationValidationUtil.ValidateAggregationFilter(_parent.HasFilter, that._parent.HasFilter); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { service.AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); AggregationMethodFactoryRate that = (AggregationMethodFactoryRate)intoTableAgg; if (IntervalMSec != that.IntervalMSec) { throw new ExprValidationException(string.Format("The size is {0} and provided is {1}", IntervalMSec, that.IntervalMSec)); } service.AggregationMethodFactoryUtil.ValidateAggregationUnbound(!IsEver, !that.IsEver); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactoryCount) intoTableAgg; AggregationValidationUtil.ValidateAggregationFilter(_parent.HasFilter, that._parent.HasFilter); if (_parent.IsDistinct) AggregationValidationUtil.ValidateAggregationInputType(_countedValueType, that._countedValueType); if (_ignoreNulls != that._ignoreNulls) throw new ExprValidationException("The aggregation declares" + (_ignoreNulls ? "" : " no") + " ignore nulls and provided is" + (that._ignoreNulls ? "" : " no") + " ignore nulls"); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationValidationUtil.ValidateAggregationType(this, intoTableAgg); var that = (AggregationMethodFactoryMinMax) intoTableAgg; AggregationValidationUtil.ValidateAggregationInputType(ResultType, that.ResultType); AggregationValidationUtil.ValidateAggregationFilter(_parent.HasFilter, that._parent.HasFilter); if (_parent.MinMaxTypeEnum != that._parent.MinMaxTypeEnum) throw new ExprValidationException( "The aggregation declares " + _parent.MinMaxTypeEnum.GetExpressionText() + " and provided is " + that._parent.MinMaxTypeEnum.GetExpressionText()); AggregationValidationUtil.ValidateAggregationUnbound(_hasDataWindows, that._hasDataWindows); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); ExprRateAggNodeFactory that = (ExprRateAggNodeFactory)intoTableAgg; if (_intervalMSec != that._intervalMSec) { throw new ExprValidationException("The size is " + _intervalMSec + " and provided is " + that._intervalMSec); } AggregationMethodFactoryUtil.ValidateAggregationUnbound(!_isEver, !that._isEver); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); ExprNthAggNodeFactory that = (ExprNthAggNodeFactory)intoTableAgg; AggregationMethodFactoryUtil.ValidateAggregationInputType(_childType, that._childType); if (_size != that._size) { throw new ExprValidationException("The size is " + _size + " and provided is " + that._size); } }
public override ExprNode Validate(ExprValidationContext validationContext) { if (_tableAccessColumn.AccessAccessorSlotPair == null) { throw new ExprValidationException("Invalid combination of aggregation state and aggregation accessor"); } var mfNode = (ExprAggregateAccessMultiValueNode)_aggregateAccessMultiValueNode; mfNode.ValidatePositionals(); _accessorFactory = mfNode.ValidateAggregationParamsWBinding(validationContext, _tableAccessColumn); _accessor = _accessorFactory.Accessor; return(null); }
public static void ValidateAggregationType( AggregationMethodFactory requiredFactory, AggregationMethodFactory providedFactory) { if (!TypeHelper.IsSubclassOrImplementsInterface(providedFactory.GetType(), requiredFactory.GetType())) throw new ExprValidationException( "Not a '" + requiredFactory.AggregationExpression.AggregationFunctionName + "' aggregation"); ExprAggregateNode aggNodeRequired = requiredFactory.AggregationExpression; ExprAggregateNode aggNodeProvided = providedFactory.AggregationExpression; if (aggNodeRequired.IsDistinct != aggNodeProvided.IsDistinct) throw new ExprValidationException( "The aggregation declares " + (aggNodeRequired.IsDistinct ? "a" : "no") + " distinct and provided is " + (aggNodeProvided.IsDistinct ? "a" : "no") + " distinct"); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); var that = (ExprAggMultiFunctionLinearAccessNodeFactoryMethod)intoTableAgg; AggregationMethodFactoryUtil.ValidateStreamNumZero(that._streamNum); if (_collectionEventType != null) { AggregationMethodFactoryUtil.ValidateEventType(_collectionEventType, that._collectionEventType); } else { AggregationMethodFactoryUtil.ValidateAggregationInputType(_resultType, that._resultType); } }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { service.AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); AggregationMethodFactoryMinMax that = (AggregationMethodFactoryMinMax)intoTableAgg; service.AggregationMethodFactoryUtil.ValidateAggregationInputType(Type, that.Type); service.AggregationMethodFactoryUtil.ValidateAggregationFilter(Parent.HasFilter, that.Parent.HasFilter); if (Parent.MinMaxTypeEnum != that.Parent.MinMaxTypeEnum) { throw new ExprValidationException("The aggregation declares " + Parent.MinMaxTypeEnum.GetExpressionText() + " and provided is " + that.Parent.MinMaxTypeEnum.GetExpressionText()); } service.AggregationMethodFactoryUtil.ValidateAggregationUnbound(HasDataWindows, that.HasDataWindows); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); var that = (ExprMinMaxAggrNodeFactory)intoTableAgg; AggregationMethodFactoryUtil.ValidateAggregationInputType(_type, that._type); AggregationMethodFactoryUtil.ValidateAggregationFilter(_parent.HasFilter, that._parent.HasFilter); if (_parent.MinMaxTypeEnum != that._parent.MinMaxTypeEnum) { throw new ExprValidationException( string.Format( "The aggregation declares {0} and provided is {1}", this._parent.MinMaxTypeEnum.GetExpressionText(), that._parent.MinMaxTypeEnum.GetExpressionText())); } AggregationMethodFactoryUtil.ValidateAggregationUnbound(_hasDataWindows, that._hasDataWindows); }
protected override void ValidateBindingInternal(ExprValidationContext validationContext, TableMetadata tableMetadata) { // validate group keys ValidateGroupKeys(tableMetadata); var column = (TableMetadataColumnAggregation)ValidateSubpropertyGetCol(tableMetadata, _subpropName); // validate accessor factory i.e. the parameters types and the match to the required state if (column.AccessAccessorSlotPair == null) { throw new ExprValidationException("Invalid combination of aggregation state and aggregation accessor"); } ExprAggregateAccessMultiValueNode mfNode = ((ExprAggregateAccessMultiValueNode)_aggregateAccessMultiValueNode); mfNode.ValidatePositionals(); _accessorFactory = mfNode.ValidateAggregationParamsWBinding(validationContext, column); }
public void ValidateIntoTableCompatible(AggregationMethodFactory intoTableAgg) { service.AggregationMethodFactoryUtil.ValidateAggregationType(this, intoTableAgg); AggregationMethodFactoryCount that = (AggregationMethodFactoryCount)intoTableAgg; service.AggregationMethodFactoryUtil.ValidateAggregationFilter(Parent.HasFilter, that.Parent.HasFilter); if (Parent.IsDistinct) { service.AggregationMethodFactoryUtil.ValidateAggregationInputType(CountedValueType, that.CountedValueType); } if (IgnoreNulls != that.IgnoreNulls) { throw new ExprValidationException("The aggregation declares" + (IgnoreNulls ? "" : " no") + " ignore nulls and provided is" + (that.IgnoreNulls ? "" : " no") + " ignore nulls"); } }
private static void ValidateIntoTableCompatible( string tableName, string columnName, TableMetadataColumnAggregation columnMetadata, AggregationServiceAggExpressionDesc aggDesc) { AggregationMethodFactory factoryProvided = aggDesc.Factory; AggregationMethodFactory factoryRequired = columnMetadata.Factory; try { factoryRequired.ValidateIntoTableCompatible(factoryProvided); } catch (ExprValidationException ex) { string text = GetMessage( tableName, columnName, factoryRequired.AggregationExpression, factoryProvided.AggregationExpression); throw new ExprValidationException(text + ": " + ex.Message, ex); } }