Examples of ExecAggregator


Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

      SanityManager.ASSERT(row != null, "row is null");
    }

    UserDataValue aggregatorColumn = (UserDataValue) row.getColumn(aggregatorColumnId + 1);

    ExecAggregator ua = (ExecAggregator) aggregatorColumn.getObject();
    if (ua == null)
    {
      ua = getAggregatorInstance();
      aggregatorColumn.setValue(ua);
    }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

   */
  void accumulate(DataValueDescriptor  inputColumn,
              DataValueDescriptor  aggregatorColumn)
    throws StandardException
  {
    ExecAggregator    ua;

    if (SanityManager.DEBUG)
    {
      /*
      ** Just to be on the safe side, confirm that we actually
      ** have a Aggregator in this column.
      */
      if (!(aggregatorColumn instanceof UserDataValue))
      {
        SanityManager.THROWASSERT("accumlator column is not a UserDataValue as "+
          "expected, it is a "+aggregatorColumn.getClass().getName());
      }
    }
    ua = (ExecAggregator) aggregatorColumn.getObject();

    /*
    ** If we don't have an aggregator, then we have to
    ** create one now.  This happens when the input result
    ** set is null.
    */
    if (ua == null)
    {
      ua = getAggregatorInstance();
    }
 
    ua.accumulate(inputColumn, this);
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

      SanityManager.ASSERT(outputColumn != null, "otuputColumn is null");
      SanityManager.ASSERT(aggregatorColumn instanceof UserDataValue,
        "accumlator column is not a UserDataValue as expected");
    }

    ExecAggregator ua = (ExecAggregator) aggregatorColumn.getObject();

    /*
    ** If we don't have an aggregator, then we have to
    ** create one now.  This happens when the input result
    ** set is null.
    */
    if (ua == null)
    {
      ua = getAggregatorInstance();
   

    /*
    **
    ** We are going to copy
    ** then entire DataValueDescriptor into the result column.
    ** We could call setValue(result.setObject()), but we
    ** might loose state (e.g. SQLBit.getObject() returns a
    ** byte[] which looses the precision of the bit. 
    **
    */
   
    DataValueDescriptor result = ua.getResult();
    if (result == null)
      outputColumn.setToNull();
    else
      outputColumn.setValue(result);

    return ua.didEliminateNulls();
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

   * @exception StandardException on error
   */
  ExecAggregator getAggregatorInstance()
    throws StandardException
  {
    ExecAggregator aggregatorInstance;
    if (cachedAggregator == null)
    {
      try
      {
        Class aggregatorClass = cf.loadApplicationClass(aggInfo.getAggregatorClassName());
        Object agg = aggregatorClass.newInstance();
        aggregatorInstance = (ExecAggregator)agg;
        cachedAggregator = aggregatorInstance;
        aggregatorInstance.setup(aggInfo.getAggregateName());

      } catch (Exception e)
      {
        throw StandardException.unexpectedUserException(e);
      }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

   */
  void merge(Storable aggregatorColumnIn,
            Storable aggregatorColumnOut)
    throws StandardException
  {
    ExecAggregator  uaIn;
    ExecAggregator  uaOut;

    if (SanityManager.DEBUG)
    {
      /*
      ** Just to be on the safe side, confirm that we actually
      ** have a Aggregator in this column.
      */
      if (!(aggregatorColumnIn instanceof UserDataValue))
      {
        SanityManager.THROWASSERT("aggregatorColumnOut column is not "+
          "a UserAggreator as expected, "+
          "it is a "+aggregatorColumnIn.getClass().getName());
      }
      if (!(aggregatorColumnOut instanceof UserDataValue))
      {
        SanityManager.THROWASSERT("aggregatorColumnIn column is not"+
          " a UserAggreator as expected, "+
          "it is a "+aggregatorColumnOut.getClass().getName());
      }
    }
    uaIn = (ExecAggregator)(((UserDataValue) aggregatorColumnIn).getObject());
    uaOut = (ExecAggregator)(((UserDataValue) aggregatorColumnOut).getObject());

    uaOut.merge(uaIn);
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

      SanityManager.ASSERT(row != null, "row is null");
    }

    UserDataValue aggregatorColumn = (UserDataValue) row.getColumn(aggregatorColumnId + 1);

    ExecAggregator ua = (ExecAggregator) aggregatorColumn.getObject();
    if (ua == null)
    {
      ua = getAggregatorInstance();
      aggregatorColumn.setValue(ua);
    }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

   */
  void accumulate(DataValueDescriptor  inputColumn,
              DataValueDescriptor  aggregatorColumn)
    throws StandardException
  {
    ExecAggregator    ua;

    if (SanityManager.DEBUG)
    {
      /*
      ** Just to be on the safe side, confirm that we actually
      ** have a Aggregator in this column.
      */
      if (!(aggregatorColumn instanceof UserDataValue))
      {
        SanityManager.THROWASSERT("accumlator column is not a UserDataValue as "+
          "expected, it is a "+aggregatorColumn.getClass().getName());
      }
    }
    ua = (ExecAggregator) aggregatorColumn.getObject();

    /*
    ** If we don't have an aggregator, then we have to
    ** create one now.  This happens when the input result
    ** set is null.
    */
    if (ua == null)
    {
      ua = getAggregatorInstance();
    }
 
    ua.accumulate(inputColumn, this);
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

      SanityManager.ASSERT(outputColumn != null, "otuputColumn is null");
      SanityManager.ASSERT(aggregatorColumn instanceof UserDataValue,
        "accumlator column is not a UserDataValue as expected");
    }

    ExecAggregator ua = (ExecAggregator) aggregatorColumn.getObject();

    /*
    ** If we don't have an aggregator, then we have to
    ** create one now.  This happens when the input result
    ** set is null.
    */
    if (ua == null)
    {
      ua = getAggregatorInstance();
   

    /*
    **
    ** We are going to copy
    ** then entire DataValueDescriptor into the result column.
    ** We could call setValue(result.setObject()), but we
    ** might loose state (e.g. SQLBit.getObject() returns a
    ** byte[] which looses the precision of the bit. 
    **
    */
   
    DataValueDescriptor result = ua.getResult();
    if (result == null)
      outputColumn.setToNull();
    else
      outputColumn.setValue(result);

    return ua.didEliminateNulls();
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

   * @exception StandardException on error
   */
  ExecAggregator getAggregatorInstance()
    throws StandardException
  {
    ExecAggregator aggregatorInstance;
    if (cachedAggregator == null)
    {
      try
      {
        Class aggregatorClass = cf.loadApplicationClass(aggInfo.getAggregatorClassName());
        Object agg = aggregatorClass.newInstance();
        aggregatorInstance = (ExecAggregator)agg;
        cachedAggregator = aggregatorInstance;
        aggregatorInstance.setup(aggInfo.getAggregateName());

      } catch (Exception e)
      {
        throw StandardException.unexpectedUserException(e);
      }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecAggregator

   */
  void merge(Storable aggregatorColumnIn,
            Storable aggregatorColumnOut)
    throws StandardException
  {
    ExecAggregator  uaIn;
    ExecAggregator  uaOut;

    if (SanityManager.DEBUG)
    {
      /*
      ** Just to be on the safe side, confirm that we actually
      ** have a Aggregator in this column.
      */
      if (!(aggregatorColumnIn instanceof UserDataValue))
      {
        SanityManager.THROWASSERT("aggregatorColumnOut column is not "+
          "a UserAggreator as expected, "+
          "it is a "+aggregatorColumnIn.getClass().getName());
      }
      if (!(aggregatorColumnOut instanceof UserDataValue))
      {
        SanityManager.THROWASSERT("aggregatorColumnIn column is not"+
          " a UserAggreator as expected, "+
          "it is a "+aggregatorColumnOut.getClass().getName());
      }
    }
    uaIn = (ExecAggregator)(((UserDataValue) aggregatorColumnIn).getObject());
    uaOut = (ExecAggregator)(((UserDataValue) aggregatorColumnOut).getObject());

    uaOut.merge(uaIn);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.