lf-edge / ekuiper

Lightweight data stream processing engine for IoT edge
https://ekuiper.org
Apache License 2.0
1.47k stars 413 forks source link

Stream definition is not updated with rule restarted #102

Closed jinfahua closed 4 years ago

jinfahua commented 4 years ago
  1. Create a stream with below schema.
    {
    "sql" : "create stream demo (temperature float, humidity bigint) WITH (FORMAT=\"JSON\", DATASOURCE=\"devices/+/messages\" )"
    }
  2. Create a rule that referenced a field that does not existed in stream schema, such as in below. The light field does not existed in previous stream definition.
    {
    "id": "rule1",
    "sql": "SELECT light FROM demo",
    "actions": [
    {
      "mqtt": {
        "server": "tcp://${mqtt_srv}:1883",
        "topic": "devices/result",
        "qos": 1,
        "clientId": "demo_001"
      }
    }
    ]
    }
  3. Drop & re-create a stream definition that includes new light definition as in below.
    {
    "sql" : "create stream demo (temperature float, humidity bigint, light bigint) WITH (FORMAT=\"JSON\", DATASOURCE=\"devices/+/messages\" )"
    }
  4. Restart the rule, but the light value still cannot be fetch.
jinfahua commented 4 years ago

Already supported, and close the issue.