Exemple #1
0
        public static long Delete(RecordSet Extent, Predicate Where)
        {

            long n = 0;
            RecordSet rs = new RecordSet(Extent.Columns);
            RecordWriter w = rs.OpenWriter();
            FastReadPlan plan = new FastReadPlan(Extent, Where.NOT, new FNodeSet(Extent.Columns), w);
            plan.Execute();
            w.Close();
            n = Extent.Count - rs.Count;
            Extent._Cache = rs._Cache;
            return n;

            //long n = 0;
            //StaticRegister mem = new StaticRegister(null);
            //Where.AssignRegister(mem);
            //for (int i = Extent.Count - 1; i >= 0; i--)
            //{
            //    mem.Assign(Extent[i]);
            //    if (Where.Render())
            //    {
            //        Extent.Remove(i);
            //        n++;
            //    }

            //}
            //return n;

        }
Exemple #2
0
        // RecordSet SELECTS //
        public static RecordSet SELECT(DataSet Data, FNodeSet Nodes, Predicate Where)
        {

            RecordSet rs = new RecordSet(Nodes.Columns);
            RecordWriter w = rs.OpenWriter();
            FastReadPlan plan = new FastReadPlan(Data, Where, Nodes, w);
            plan.Execute();
            w.Close();
            return rs;

        }
Exemple #3
0
        public override Table Extend(string Dir, string Name, DataSet Data, FNodeSet ClusterVariables, FNodeSet OtherKeepers, Predicate Where)
        {

            // Check that the ClusterVariable count matches the internal node set count //
            if (ClusterVariables.Count != this._fields.Count)
                throw new ArgumentException("The cluster variable count passed does not match the internal cluster variable count");

            // Create the selectors //
            FNodeSet values = OtherKeepers.CloneOfMe();
            FNode n = new FNodeResult(null, new RowClusterCellFunction(this._rule, this._means));
            foreach (FNode t in ClusterVariables.Nodes)
            {
                n.AddChildNode(t.CloneOfMe());
            }
            values.Add("CLUSTER_ID", n);

            // Build a recordset //
            Table tablix = new Table(Dir, Name, values.Columns, Data.MaxRecords);
            RecordWriter w = tablix.OpenWriter();

            // Run a fast select //
            FastReadPlan plan = new FastReadPlan(Data, Where, values, w);
            w.Close();

            return tablix;

        }
Exemple #4
0
        public override void Extend(RecordWriter Output, DataSet Data, FNodeSet ClusterVariables, FNodeSet OtherKeepers, Predicate Where)
        {

            // Check that the ClusterVariable count matches the internal node set count //
            if (ClusterVariables.Count != this._fields.Count)
                throw new ArgumentException("The cluster variable count passed does not match the internal cluster variable count");

            // Create the selectors //
            FNodeSet values = OtherKeepers.CloneOfMe();
            FNode n = new FNodeResult(null, new RowClusterCellFunction(this._rule, this._means));
            foreach (FNode t in ClusterVariables.Nodes)
            {
                n.AddChildNode(t.CloneOfMe());
            }
            values.Add("CLUSTER_ID", n);

            // Run a fast select //
            FastReadPlan plan = new FastReadPlan(Data, Where, values, Output);

        }
Exemple #5
0
        // Table SELECTS //
        public static Table SELECT(string Dir, string Name, DataSet Data, FNodeSet Nodes, Predicate Where)
        {

            Table rs = new Table(Dir, Name, Nodes.Columns);
            RecordWriter w = rs.OpenWriter();
            FastReadPlan plan = new FastReadPlan(Data, Where, Nodes, w);
            plan.Execute();
            w.Close();
            return rs;

        }