Ejemplo n.º 1
0
        internal Table(Command command, TableMD tableMetadata, int tableId)
        {
            m_tableMetadata = tableMetadata;
            m_columns = Command.CreateVarList();
            m_keys = command.CreateVarVec();
            m_nonnullableColumns = command.CreateVarVec();
            m_tableId = tableId;

            var columnVarMap = new Dictionary<string, ColumnVar>();
            foreach (var c in tableMetadata.Columns)
            {
                var v = command.CreateColumnVar(this, c);
                columnVarMap[c.Name] = v;
                if (!c.IsNullable)
                {
                    m_nonnullableColumns.Set(v);
                }
            }

            foreach (var c in tableMetadata.Keys)
            {
                var v = columnVarMap[c.Name];
                m_keys.Set(v);
            }

            m_referencedColumns = command.CreateVarVec(m_columns);
        }
Ejemplo n.º 2
0
        internal Table(Command command, TableMD tableMetadata, int tableId)
        {
            m_tableMetadata      = tableMetadata;
            m_columns            = Command.CreateVarList();
            m_keys               = command.CreateVarVec();
            m_nonnullableColumns = command.CreateVarVec();
            m_tableId            = tableId;

            var columnVarMap = new Dictionary <string, ColumnVar>();

            foreach (var c in tableMetadata.Columns)
            {
                var v = command.CreateColumnVar(this, c);
                columnVarMap[c.Name] = v;
                if (!c.IsNullable)
                {
                    m_nonnullableColumns.Set(v);
                }
            }

            foreach (var c in tableMetadata.Keys)
            {
                var v = columnVarMap[c.Name];
                m_keys.Set(v);
            }

            m_referencedColumns = command.CreateVarVec(m_columns);
        }
Ejemplo n.º 3
0
        internal virtual Table CreateTableInstance(TableMD tableMetadata)
        {
            Table table = new Table(this, tableMetadata, this.NewTableId());

            this.m_tables.Add(table);
            return(table);
        }
Ejemplo n.º 4
0
        internal Table(Command command, TableMD tableMetadata, int tableId)
        {
            this.m_tableMetadata      = tableMetadata;
            this.m_columns            = Command.CreateVarList();
            this.m_keys               = command.CreateVarVec();
            this.m_nonnullableColumns = command.CreateVarVec();
            this.m_tableId            = tableId;
            Dictionary <string, ColumnVar> dictionary = new Dictionary <string, ColumnVar>();

            foreach (ColumnMD column in tableMetadata.Columns)
            {
                ColumnVar columnVar = command.CreateColumnVar(this, column);
                dictionary[column.Name] = columnVar;
                if (!column.IsNullable)
                {
                    this.m_nonnullableColumns.Set((Var)columnVar);
                }
            }
            foreach (ColumnMD key in tableMetadata.Keys)
            {
                this.m_keys.Set((Var)dictionary[key.Name]);
            }
            this.m_referencedColumns = command.CreateVarVec((IEnumerable <Var>) this.m_columns);
        }
Ejemplo n.º 5
0
 internal virtual ScanViewOp CreateScanViewOp(TableMD tableMetadata)
 {
     return(this.CreateScanViewOp(this.CreateTableInstance(tableMetadata)));
 }
Ejemplo n.º 6
0
 // <summary>
 // Creates a new table instance
 // </summary>
 // <param name="tableMetadata"> table metadata </param>
 // <returns> A new Table instance with columns as defined in the specified metadata </returns>
 internal virtual Table CreateTableInstance(TableMD tableMetadata)
 {
     var t = new Table(this, tableMetadata, NewTableId());
     m_tables.Add(t);
     return t;
 }
Ejemplo n.º 7
0
 // <summary>
 // Creates an instance of a ScanViewOp
 // </summary>
 // <param name="tableMetadata"> the table metadata </param>
 // <returns> a new ScanViewOp </returns>
 internal virtual ScanViewOp CreateScanViewOp(TableMD tableMetadata)
 {
     var table = CreateTableInstance(tableMetadata);
     return CreateScanViewOp(table);
 }