...
The end of the subquery is defined by the outputconnectors. If, as in the example above, multiple output ports should be available, each port must be defined with this connector.
Hint: Each value defined outside in the query are available inside the query. So there is something like this possible:
Outside-Query
Code Block |
---|
#DEFINE sm_schema [['i', 'STARTTIMESTAMP'],['v','Double'],['c','Double'],['batch','Integer']]
[...]
features = SUBQUERY({
queryfile = '${preprocessing_subquery}',
name = 'P and Q calculation',
schema = ${feature_schema},
options = [['OUTOFORDER','${OUTOFORDER}']]
},
sm_data_ooo
)
[...] |
Part of subquery
Code Block |
---|
sm_data = CONNECTOR({
port = 0,
source = 'preprocessing_source',
schema = ${sm_schema}
}
)
[...]
calc_w1 = PREDICATEWINDOW({
start = 'true',
#IF OUTOFORDER="TRUE"
end = "!isNull(__last_1.i) && floor(__last_1.i/${w1_size}) != floor(i/${w1_size})",
#ELSE
end = "size(__all) == ${w1_size}-1",
#ENDIF
nesting = true,
keependingelement = true,
USEELEMENTONLYFORSTARTOREND = true,
allowsamestartandendts = true,
keepTimeOrder = false
},
w1_preprocess
) |
Additional: The options given are available in the query query as parameters in Odysseus Script format (i.e. ${OUTOFORDER} in the above example)