Exemple #1
0
        // <summary>
        // Clone an UnnestOp
        // </summary>
        // <param name="op"> The Op to Copy </param>
        // <param name="n"> The Node that references the Op </param>
        // <returns> A copy of the original Node that references a copy of the original Op </returns>
        public override Node Visit(UnnestOp op, Node n)
        {
            // Visit the Node's children and map their Vars
            var children = ProcessChildren(n);

            // Get the mapped unnest-var
            var mappedVar = GetMappedVar(op.Var);

            // Create a new unnestOp
            var newTable  = m_destCmd.CreateTableInstance(op.Table.TableMetadata);
            var newUnnest = m_destCmd.CreateUnnestOp(mappedVar, newTable);

            // Map the corresponding tables/columns
            MapTable(newUnnest.Table, op.Table);

            // create the unnest node
            return(m_destCmd.CreateNode(newUnnest, children));
        }