Examples of AggregateType


Examples of com.alibaba.druid.support.monitor.annotation.AggregateType

            FieldInfo fieldInfo = fields.get(i);
            if (i != 0) {
                buf.append(", ");
            }

            AggregateType aggregateType = fieldInfo.getField().getAnnotation(MField.class).aggregate();

            switch (aggregateType) {
                case Sum:
                    buf.append("SUM(");
                    buf.append(fieldInfo.getColumnName());
View Full Code Here

Examples of com.alibaba.druid.support.monitor.annotation.AggregateType

            FieldInfo fieldInfo = fields.get(i);
            if (i != 0) {
                buf.append(", ");
            }

            AggregateType aggregateType = fieldInfo.getField().getAnnotation(MField.class).aggregate();

            switch (aggregateType) {
                case Sum:
                    buf.append("SUM(");
                    buf.append(fieldInfo.getColumnName());
View Full Code Here

Examples of com.alibaba.wasp.plan.parser.AggregateInfo.AggregateType

      }
      scan.setFilter(filters);

      String tableName =  StorageTableNameBuilder.buildEntityTableName(plan.getTableDesc().getTableName());

      AggregateType type = info.getAggregateType();

      byte[] value = null;
      DataType resultDataType = DataType.STRING;

      try {
        switch (type) {
          case COUNT: {
            long count = aggregationClient.count(Bytes.toBytes(tableName),
                null, scan);
            value = Bytes.toBytes(count);
            resultDataType = DataType.INT64;
            break;
          }
          case SUM: {
            value = getSumValue(tableName, info.getField(), scan);
            resultDataType = info.getField().getType();
            break;
          }
        }
      } catch (Throwable throwable) {
        throw new ServiceException(throwable);
      }

      ClientProtos.QueryResultProto.Builder builder = ClientProtos.QueryResultProto.newBuilder();
            builder.addResult(ProtobufUtil.toStringBytesPair(new KeyValue(Bytes.toBytes(type.getMethodName()),
                Bytes.toBytes(info.getField().getFamily()), Bytes.toBytes(type.getMethodName()), value)));
            queryResultProtos.add(builder.build());

      MetaProtos.DataTypeProtos dataTypeProtos = DataType.convertDataTypeToDataTypeProtos(resultDataType) ;
            ClientProtos.StringDataTypePair.Builder stringDataTypePairBuilder = ClientProtos.StringDataTypePair
              .newBuilder();
      stringDataTypePairBuilder.setDataType(dataTypeProtos);
      stringDataTypePairBuilder.setName(type.getMethodName());
      nameDataTypePairs.add(stringDataTypePairBuilder.build());

      return new Pair<List<ClientProtos.QueryResultProto>, List<ClientProtos.StringDataTypePair>>(
          queryResultProtos, nameDataTypePairs);
    }
View Full Code Here

Examples of org.dmg.pmml._40.AggregateType

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetAggregate(AggregateType newAggregate, NotificationChain msgs) {
    AggregateType oldAggregate = aggregate;
    aggregate = newAggregate;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.DERIVED_FIELD_TYPE__AGGREGATE, oldAggregate, newAggregate);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

Examples of org.dmg.pmml._40.AggregateType

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetAggregate(AggregateType newAggregate, NotificationChain msgs) {
    AggregateType oldAggregate = aggregate;
    aggregate = newAggregate;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.DEFINE_FUNCTION_TYPE__AGGREGATE, oldAggregate, newAggregate);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
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.