Package org.apache.derby.iapi.util

Examples of org.apache.derby.iapi.util.JBitSet


    }
    else
    {
      /* See if other side contains a column reference from the same table */
      JBitSet referencedTables = arg1.getTablesReferenced();
      /* See if other columns are all correlation columns */
      int index = 0;
      int colNumber =  ((ColumnReference) arg2).getColumnNumber();
      for ( ; index < tableNumbers.length; index++)
      {
        if (referencedTables.get(tableNumbers[index]))
        {
          break;
        }
      }
      /* Correlation column, so we can treat it as a constant */
      if (index == tableNumbers.length)
      {
        setValueCols(tableColMap, eqOuterCols, colNumber, resultTable);
      }
      else if (tableColMap != null && !referencedTables.get(tableNumber))
      {
        tableColMap[index].set(colNumber);
      }
    }
  }
View Full Code Here


   */
  public boolean selfComparison(ColumnReference cr)
    throws StandardException
  {
    ValueNode  otherSide;
    JBitSet    tablesReferenced;

    /*
    ** Figure out which side the given ColumnReference is on,
    ** and look for the same table on the other side.
    */
    if (leftOperand == cr)
    {
      otherSide = rightOperand;
    }
    else if (rightOperand == cr)
    {
      otherSide = leftOperand;
    }
    else
    {
      otherSide = null;
      if (SanityManager.DEBUG)
      {
        SanityManager.THROWASSERT(
            "ColumnReference not found on either side of binary comparison.");
      }
    }

    tablesReferenced = otherSide.getTablesReferenced();

    /* Return true if the table we're looking for is in the bit map */
    return tablesReferenced.get(cr.getTableNumber());
  }
View Full Code Here

    if (isInListProbeNode())
      return false;

    FromTable  ft;
    ValueNode  otherSide = null;
    JBitSet    tablesReferenced;
    ColumnReference  cr = null;
    boolean  found = false;
    boolean walkSubtree = true;

    ft = (FromTable) optTable;
View Full Code Here

     * ColumnReference is supposed to be scoped for childRSN.  We
     * do that by figuring out what underlying base table the column
     * reference is pointing to and then seeing if that base table
     * is included in the list of table numbers from the parentRSN.
     */
    JBitSet crTables = new JBitSet(parentRSNsTables.size());
    BaseTableNumbersVisitor btnVis =
      new BaseTableNumbersVisitor(crTables);
    cr.accept(btnVis);

    /* If the column reference in question is not intended for
View Full Code Here

   */
  private void initBaseTableVisitor(int numTablesInQuery,
    boolean initOptBaseTables)
  {
    if (valNodeBaseTables == null)
      valNodeBaseTables = new JBitSet(numTablesInQuery);
    else
      valNodeBaseTables.clearAll();

    if (initOptBaseTables)
    {
      if (optBaseTables == null)
        optBaseTables = new JBitSet(numTablesInQuery);
      else
        optBaseTables.clearAll();
    }

    // Now create the visitor.  We give it valNodeBaseTables
View Full Code Here

                 ValueNode searchClause)
        throws StandardException
  {
    AndNode    thisAnd;
    AndNode    topAnd;
    JBitSet    newJBitSet;
    Predicate  newPred;
    BooleanConstantNode  trueNode = null;

    if (searchClause != null)
    {
      topAnd = (AndNode) searchClause;
      searchClause = null;
      trueNode = (BooleanConstantNode) getNodeFactory().getNode(
                      C_NodeTypes.BOOLEAN_CONSTANT_NODE,
                      Boolean.TRUE,
                      getContextManager());
     
      while (topAnd.getRightOperand() instanceof AndNode)
      {
        /* Break out the next top AndNode */
        thisAnd = topAnd;
        topAnd = (AndNode) topAnd.getRightOperand();
        thisAnd.setRightOperand(null);

        /* Set the rightOperand to true */
        thisAnd.setRightOperand(trueNode);

        /* Add the top AndNode to the PredicateList */
        newJBitSet = new JBitSet(numTables);
        newPred = (Predicate) getNodeFactory().getNode(
                      C_NodeTypes.PREDICATE,
                      thisAnd,
                      newJBitSet,
                      getContextManager());
        addPredicate(newPred);
      }
     
      /* Add the last top AndNode to the PredicateList */
      newJBitSet = new JBitSet(numTables);
      newPred = (Predicate) getNodeFactory().getNode(
                      C_NodeTypes.PREDICATE,
                      topAnd,
                      newJBitSet,
                      getContextManager());
View Full Code Here

                          C_NodeTypes.AND_NODE,
                          leftOperand,
                          trueNode,
                          getContextManager());
        newAnd.postBindFixup();
        JBitSet tableMap = new JBitSet(select.referencedTableMap.size());

        // Use newly constructed predicate
        predicate = (Predicate) getNodeFactory().getNode(
                        C_NodeTypes.PREDICATE,
                        newAnd,
View Full Code Here

      if (! predicate.getPushable())
      {
        continue;
      }

      JBitSet curBitSet = predicate.getReferencedSet();
     
      /* Do we have a match? */
      if (referencedTableMap.contains(curBitSet))
      {
        /* Add the matching predicate to the push list */
 
View Full Code Here

                            newEquals,
                            trueNode,
                            getContextManager());
          newAnd.postBindFixup();
          // Add a new predicate to both the equijoin clauses and this list
          JBitSet tableMap = new JBitSet(numTables);
          newAnd.categorize(tableMap, false);
          Predicate newPred = (Predicate) getNodeFactory().getNode(
                          C_NodeTypes.PREDICATE,
                          newAnd,
                          tableMap,
View Full Code Here

                            roClone,
                            trueNode,
                            getContextManager());
          newAnd.postBindFixup();
          // Add a new predicate to both the search clauses and this list
          JBitSet tableMap = new JBitSet(numTables);
          newAnd.categorize(tableMap, false);
          Predicate newPred = (Predicate) getNodeFactory().getNode(
                            C_NodeTypes.PREDICATE,
                            newAnd,
                            tableMap,
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.util.JBitSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.