{
  "tests": [
    {
      "name": "date to string",
      "statements": [
        "CREATE STREAM TEST (ID bigint, START_DATE int, DATE_FORMAT varchar) WITH (kafka_topic='test_topic', value_format='JSON');",
        "CREATE STREAM DATE_STREAM AS select ID, datetostring(START_DATE, DATE_FORMAT) as CUSTOM_FORMATTED_START_DATE from test;"
      ],
      "inputs": [
        {"topic": "test_topic", "value": {"ID": 1, "START_DATE": 17662, "DATE_FORMAT": "yyyy-MM-dd"}},
        {"topic": "test_topic", "value": {"ID": 2, "START_DATE": 18027, "DATE_FORMAT": "dd/MM/yyyy"}},
        {"topic": "test_topic", "value": {"ID": 3, "START_DATE": 18993, "DATE_FORMAT": "dd-MMM-yyyy"}},
        {"topic": "test_topic", "value": {"ID": 4, "START_DATE": 0, "DATE_FORMAT": "dd-MM-yyyy"}},
        {"topic": "test_topic", "value": {"ID": 5, "START_DATE": -1, "DATE_FORMAT": "dd-MM-yyyy'Sophia'"}}

      ],
      "outputs": [
        {"topic": "DATE_STREAM", "value": {"ID": 1, "CUSTOM_FORMATTED_START_DATE": "2018-05-11"}},
        {"topic": "DATE_STREAM", "value": {"ID": 2, "CUSTOM_FORMATTED_START_DATE": "11/05/2019"}},
        {"topic": "DATE_STREAM", "value": {"ID": 3, "CUSTOM_FORMATTED_START_DATE": "01-Jan-2022"}},
        {"topic": "DATE_STREAM", "value": {"ID": 4, "CUSTOM_FORMATTED_START_DATE": "01-01-1970"}},
        {"topic": "DATE_STREAM", "value": {"ID": 5, "CUSTOM_FORMATTED_START_DATE": "31-12-1969Sophia"}}
      ]
    }
  ]
}


