예제 #1
0
        public override bool Equals(object o)
        {
            if (this == o) {
                return true;
            }

            if (o == null || GetType() != o.GetType()) {
                return false;
            }

            var that = (IndexMultiKey) o;

            if (IsUnique != that.IsUnique) {
                return false;
            }

            if (!CompatExtensions.AreEqual(HashIndexedProps, that.HashIndexedProps)) {
                return false;
            }

            if (!CompatExtensions.AreEqual(RangeIndexedProps, that.RangeIndexedProps)) {
                return false;
            }

            if (AdvancedIndexDesc == null) {
                return that.AdvancedIndexDesc == null;
            }

            return that.AdvancedIndexDesc != null && AdvancedIndexDesc.EqualsAdvancedIndex(that.AdvancedIndexDesc);
        }
 private static void ValidateCompare(
     int[] one,
     int[] other)
 {
     if (CompatExtensions.AreEqual(one, other)) {
         throw new GroupByRollupDuplicateException(one);
     }
 }
예제 #3
0
        public override bool Equals(object other)
        {
            if (other == this) {
                return true;
            }

            if (other is HashableMultiKeyEventPair otherKeys) {
                return CompatExtensions.AreEqual(keys, otherKeys.keys);
            }

            return false;
        }
예제 #4
0
        public override bool Equals(object other)
        {
            if (other == this) {
                return true;
            }

            if (other is HashableMultiKey) {
                var otherKeys = (HashableMultiKey) other;
                return CompatExtensions.AreEqual(Keys, otherKeys.Keys);
            }

            return false;
        }
예제 #5
0
        public override bool Equals(object o)
        {
            if (this == o) {
                return true;
            }

            if (o == null || GetType() != o.GetType()) {
                return false;
            }

            var that = (IntSeqKeyMany) o;
            return CompatExtensions.AreEqual(Array, that.Array);
        }
예제 #6
0
        public override IList<int[]> Evaluate(GroupByRollupEvalContext context)
        {
            IList<int[]> rollup = new List<int[]>();
            foreach (var node in ChildNodes) {
                var result = node.Evaluate(context);

                // find dups
                foreach (var row in result) {
                    foreach (var existing in rollup) {
                        if (CompatExtensions.AreEqual(row, existing)) {
                            throw new GroupByRollupDuplicateException(row);
                        }
                    }
                }

                rollup.AddAll(result);
            }

            return rollup;
        }
예제 #7
0
        private static bool IsCustomIndexMatch(
            KeyValuePair<IndexMultiKey, EventTableIndexMetadataEntry> index,
            KeyValuePair<QueryGraphValueEntryCustomKeyForge, QueryGraphValueEntryCustomOperationForge> op)
        {
            if (index.Value.ExplicitIndexNameIfExplicit == null || index.Value.OptionalQueryPlanIndexItem == null) {
                return false;
            }

            var provision = index.Key.AdvancedIndexDesc;
            if (provision == null) {
                return false;
            }

            var provisionDesc =
                index.Value.OptionalQueryPlanIndexItem.AdvancedIndexProvisionDesc;
            if (!provisionDesc.Factory.Forge.ProvidesIndexForOperation(op.Key.OperationName)) {
                return false;
            }

            var opExpressions = op.Key.ExprNodes;
            var opProperties = GetPropertiesPerExpressionExpectSingle(opExpressions);
            var indexProperties = index.Key.AdvancedIndexDesc.IndexedProperties;
            return CompatExtensions.AreEqual(indexProperties, opProperties);
        }