Template Formatter
The TEMPLATE formatter plugin is optionally invoked in a SELECT statement and enables user to provide a default output string with wild cards, and specify what selected values should replace those wildcards. The TEMPLATE plugin offers flexibity to arrange the output any way you want.
Parameters
pattern: The default output string. Substitution strings are represented with a dollar sign followed by curly braces: ${column1}
Syntax
formatter TEMPLATE (
pattern <string representing column header, OR integeter represending column index starting from 1>
)
Example
Selecting 2 columns and replacing them with selected values, referenced by column name:
select symbol, bid
from my_bench_stream
output stdout
formatter template(
pattern "Symbol is: ${symbol}, Bid is: ${bid}"
);
Selecting 2 columns and replacing them with selected values, referenced by column index:
select symbol, bid
from my_bench_stream
output stdout
formatter template(
pattern "Symbol is: ${1}, Bid is: ${2}"
);