Package org.apache.derby.iapi.util

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


     * implement full outer join.
     */
    // Walk joinPredicates backwards due to possible deletes
    for (int index = joinPredicates.size() - 1; index >= 0; index --)
    {
      JBitSet    curBitSet;
      Predicate predicate;

      predicate = (Predicate) joinPredicates.elementAt(index);
      if (! predicate.getPushable())
      {
View Full Code Here


  protected void pushExpressionsToLeft(PredicateList outerPredicateList)
    throws StandardException
  {
    FromTable    leftFromTable = (FromTable) leftResultSet;

    JBitSet    leftReferencedTableMap = leftFromTable.getReferencedTableMap();

    /* Build a list of the single table predicates on left result set
     * that we can push down
     */
    // Walk outerPredicateList backwards due to possible deletes
    for (int index = outerPredicateList.size() - 1; index >= 0; index --)
    {
      JBitSet    curBitSet;
      Predicate predicate;

      predicate = (Predicate) outerPredicateList.elementAt(index);
      if (! predicate.getPushable())
      {
View Full Code Here

  private void pushExpressionsToRight(PredicateList outerPredicateList)
    throws StandardException
  {
    FromTable    rightFromTable = (FromTable) rightResultSet;

    JBitSet    rightReferencedTableMap = rightFromTable.getReferencedTableMap();

    /* Build a list of the single table predicates on right result set
     * that we can push down
     */
    // Walk outerPredicateList backwards due to possible deletes
    for (int index = outerPredicateList.size() - 1; index >= 0; index --)
    {
      JBitSet    curBitSet;
      Predicate predicate;

      predicate = (Predicate) outerPredicateList.elementAt(index);
      if (! predicate.getPushable())
      {
View Full Code Here

    throws StandardException
  {
    FromTable    leftFromTable = (FromTable) leftResultSet;
    FromTable    rightFromTable = (FromTable) rightResultSet;

    JBitSet    leftReferencedTableMap = leftFromTable.getReferencedTableMap();
    JBitSet    rightReferencedTableMap = rightFromTable.getReferencedTableMap();

    /* Build a list of the join predicates that we can push down */
    // Walk outerPredicateList backwards due to possible deletes
    for (int index = outerPredicateList.size() - 1; index >= 0; index --)
    {
      JBitSet    curBitSet;
      Predicate predicate;

      predicate = (Predicate) outerPredicateList.elementAt(index);
      if (! predicate.getPushable())
      {
        continue;
      }

      curBitSet = predicate.getReferencedSet();
     
      /* Do we have a match? */
      JBitSet innerBitSet = (JBitSet) rightReferencedTableMap.clone();
      innerBitSet.or(leftReferencedTableMap);
      if (innerBitSet.contains(curBitSet))
      {
        /* Add the matching predicate to the push list */
        joinPredicates.addPredicate(predicate);

        /* Remap all of the ColumnReferences to point to the
View Full Code Here

    // The top most LOJ may be a join betw T and X and thus we can reorder the
  // LOJs.  However, as of 10/2002, we don't reorder LOJ mixed with join.
  public JBitSet LOJgetReferencedTables(int numTables)
        throws StandardException
  {
    JBitSet map = new JBitSet(numTables);

    map = (JBitSet) leftResultSet.LOJgetReferencedTables(numTables);
    if (map == null) return null;
    else map.or((JBitSet) rightResultSet.LOJgetReferencedTables(numTables));

    return map;
  }
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

  public boolean isQualifier(Optimizable optTable, boolean forPush)
    throws StandardException
  {
    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

  }

  public JBitSet LOJgetReferencedTables(int numTables)
        throws StandardException
  {
    JBitSet map = new JBitSet(numTables);
    fillInReferencedTableMap(map);
    return map;
  }
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.