protected override NodeInfo VisitTableOp(ScanTableBaseOp op, Node n)
        {
            ExtendedNodeInfo extendedNodeInfo = this.InitExtendedNodeInfo(n);

            extendedNodeInfo.LocalDefinitions.Or(op.Table.ReferencedColumns);
            extendedNodeInfo.Definitions.Or(op.Table.ReferencedColumns);
            if (op.Table.ReferencedColumns.Subsumes(op.Table.Keys))
            {
                extendedNodeInfo.Keys.InitFrom((IEnumerable <Var>)op.Table.Keys);
            }
            extendedNodeInfo.NonNullableDefinitions.Or(op.Table.NonNullableColumns);
            extendedNodeInfo.NonNullableDefinitions.And(extendedNodeInfo.Definitions);
            return((NodeInfo)extendedNodeInfo);
        }
Esempio n. 2
0
        /// <summary>
        ///     Definitions = Local Definitions = referenced table columns
        ///     External References = none
        ///     Keys = keys of entity type
        ///     RowCount (default): MinRows = 0, MaxRows = *
        ///     NonNullableDefinitions : non nullable table columns that are definitions
        ///     NonNullableInputDefinitions : default(empty) because cannot be used
        /// </summary>
        /// <param name="op"> ScanTable/ScanView op </param>
        /// <param name="n"> current subtree </param>
        /// <returns> nodeinfo for this subtree </returns>
        protected override NodeInfo VisitTableOp(ScanTableBaseOp op, Node n)
        {
            var nodeInfo = InitExtendedNodeInfo(n);

            // #479372 - only the "referenced" columns of the table should
            // show up in the definitions
            nodeInfo.LocalDefinitions.Or(op.Table.ReferencedColumns);
            nodeInfo.Definitions.Or(op.Table.ReferencedColumns);

            // get table's keys - but only if the key columns have been referenced
            if (op.Table.ReferencedColumns.Subsumes(op.Table.Keys))
            {
                nodeInfo.Keys.InitFrom(op.Table.Keys);
            }
            // no external references

            //non-nullable definitions
            nodeInfo.NonNullableDefinitions.Or(op.Table.NonNullableColumns);
            nodeInfo.NonNullableDefinitions.And(nodeInfo.Definitions);

            return(nodeInfo);
        }
        private void HandleTableOpMetadata(ScanTableBaseOp op)
        {
            // add to the list of referenced entitysets
            var entitySet = op.Table.TableMetadata.Extent as EntitySet;
            if (entitySet != null)
            {
                // If entitySet is an association set, the appropriate entity set references will be registered inside Visit(RefOp, Node).
                AddEntitySetReference(entitySet);
            }

            var elementType = TypeUsage.Create(op.Table.TableMetadata.Extent.ElementType);
            // add to the list of structured types
            AddTypeReference(elementType);
        }
 /// <summary>
 ///     Default handler for all TableOps
 /// </summary>
 /// <param name="op"> </param>
 /// <param name="n"> </param>
 protected virtual void VisitTableOp(ScanTableBaseOp op, Node n)
 {
     VisitRelOpDefault(op, n);
 }
 protected virtual void VisitTableOp(ScanTableBaseOp op, Node n)
 {
     this.VisitRelOpDefault((RelOp)op, n);
 }
Esempio n. 6
0
 // <summary>
 // Default handler for all TableOps
 // </summary>
 protected virtual TResultType VisitTableOp(ScanTableBaseOp op, Node n)
 {
     return(VisitRelOpDefault(op, n));
 }