{
  "comments": [
    "Tests covering the use of the CONCAT function and the '+' operator"
  ],
  "tests": [
    {
      "name": "concat fields using CONCAT",
      "format": ["JSON"],
      "statements": [
        "CREATE STREAM TEST (source VARCHAR) WITH (kafka_topic='test_topic', value_format='JSON');",
        "CREATE STREAM OUTPUT AS SELECT CONCAT('prefix-', CONCAT(source, '-postfix')) AS THING FROM TEST;"
      ],
      "inputs": [
        {"topic": "test_topic", "value": {"source": "s1"}},
        {"topic": "test_topic", "value": {"source": "s2"}}
      ],
      "outputs": [
        {"topic": "OUTPUT", "value": {"THING":"prefix-s1-postfix"}},
        {"topic": "OUTPUT", "value": {"THING":"prefix-s2-postfix"}}
      ]
    },
    {
      "name": "concat fields using '+' operator",
      "format": ["JSON"],
      "statements": [
        "CREATE STREAM TEST (source VARCHAR) WITH (kafka_topic='test_topic', value_format='JSON');",
        "CREATE STREAM OUTPUT AS SELECT 'prefix-' + source + '-postfix' AS THING FROM TEST;"
      ],
      "inputs": [
        {"topic": "test_topic", "value": {"source": "s1"}},
        {"topic": "test_topic", "value": {"source": "s2"}}
      ],
      "outputs": [
        {"topic": "OUTPUT", "value": {"THING":"prefix-s1-postfix"}},
        {"topic": "OUTPUT", "value": {"THING":"prefix-s2-postfix"}}
      ]
    }
  ]
}