Java Code Examples for io.siddhi.query.api.definition.Attribute#Type

The following examples show how to use io.siddhi.query.api.definition.Attribute#Type . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomFunctionExtension.java    From siddhi with Apache License 2.0 6 votes vote down vote up
/**
 * The initialization method for FunctionExecutor, this method will be called before the other methods
 *
 * @param attributeExpressionExecutors are the executors of each function parameters
 * @param configReader
 * @param siddhiQueryContext           the context of the siddhi query
 */
@Override
protected StateFactory init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader,
                            SiddhiQueryContext siddhiQueryContext) {
    for (ExpressionExecutor expressionExecutor : attributeExpressionExecutors) {
        Attribute.Type attributeType = expressionExecutor.getReturnType();
        if (attributeType == Attribute.Type.DOUBLE) {
            returnType = attributeType;

        } else if ((attributeType == Attribute.Type.STRING) || (attributeType == Attribute.Type.BOOL)) {
            throw new SiddhiAppCreationException("Plus cannot have parameters with types String or Bool");
        } else {
            returnType = Attribute.Type.LONG;
        }
    }
    return null;
}
 
Example 2
Source File: SiddhiTypeFactory.java    From flink-siddhi with Apache License 2.0 5 votes vote down vote up
public static <F> Attribute.Type getAttributeType(TypeInformation<F> fieldType) {
    if (JAVA_TO_SIDDHI_TYPE.containsKey(fieldType.getTypeClass())) {
        return JAVA_TO_SIDDHI_TYPE.get(fieldType.getTypeClass());
    } else {
        return Attribute.Type.OBJECT;
    }
}
 
Example 3
Source File: MultiValueVariableFunctionExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
@Override
public Attribute.Type getReturnType() {
    return Attribute.Type.OBJECT;
}
 
Example 4
Source File: TestStoreConditionVisitor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
@Override
public void endVisitStreamVariable(String id, String streamId, String attributeName, Attribute.Type type) {
    //Not applicable
}
 
Example 5
Source File: DivideExpressionExecutorLong.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public Attribute.Type getReturnType() {
    return Attribute.Type.LONG;
}
 
Example 6
Source File: DistinctCountIncrementalAttributeAggregator.java    From siddhi with Apache License 2.0 4 votes vote down vote up
@Override
public Attribute.Type getReturnType() {
    return Attribute.Type.LONG;
}
 
Example 7
Source File: MinAttributeAggregatorExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public void init(Attribute.Type type) {
}
 
Example 8
Source File: ExpressionBuilder.java    From siddhi with Apache License 2.0 4 votes vote down vote up
private void buildStoreVariableExecutor(Variable variable, ExpressionVisitor expressionVisitor, Attribute.Type type,
                                        AbstractDefinition storeDefinition) {
    expressionVisitor.beginVisitStoreVariable(storeDefinition.getId(), variable.getAttributeName(), type);
    expressionVisitor.endVisitStoreVariable(storeDefinition.getId(), variable.getAttributeName(), type);

}
 
Example 9
Source File: SumAttributeAggregatorExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public Attribute.Type getReturnType() {
    return type;
}
 
Example 10
Source File: CurrentTimeMillisFunctionExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
@Override
public Attribute.Type getReturnType() {
    return Attribute.Type.LONG;
}
 
Example 11
Source File: MinForeverAttributeAggregatorExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public Attribute.Type getReturnType() {
    return type;
}
 
Example 12
Source File: VariableExpressionExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public Attribute.Type getReturnType() {
    return attribute.getType();
}
 
Example 13
Source File: SubtractExpressionExecutorDouble.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public Attribute.Type getReturnType() {
    return Attribute.Type.DOUBLE;
}
 
Example 14
Source File: SubtractExpressionExecutorLong.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public Attribute.Type getReturnType() {
    return Attribute.Type.LONG;
}
 
Example 15
Source File: CreateSetFunctionExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
@Override
public Attribute.Type getReturnType() {
    return Attribute.Type.OBJECT;
}
 
Example 16
Source File: StdDevAttributeAggregatorExecutor.java    From siddhi with Apache License 2.0 4 votes vote down vote up
@Override
public Attribute.Type getReturnType() {
    return returnType;
}
 
Example 17
Source File: Constant.java    From siddhi with Apache License 2.0 4 votes vote down vote up
public Attribute.Type getType() {
    return type;
}
 
Example 18
Source File: ExpressionVisitor.java    From siddhi with Apache License 2.0 votes vote down vote up
void beginVisitStreamVariable(String id, String streamId, String attributeName, Attribute.Type type); 
Example 19
Source File: IncrementalAttributeAggregator.java    From siddhi with Apache License 2.0 votes vote down vote up
public abstract Attribute.Type getReturnType(); 
Example 20
Source File: Script.java    From siddhi with Apache License 2.0 votes vote down vote up
public abstract void setReturnType(Attribute.Type returnType);