Uploaded image for project: 'Bahir'
  1. Bahir
  2. BAHIR-220

Add redis descriptor to make redis connection as a table

    XMLWordPrintableJSON

    Details

      Description

      currently, for Flink-1.9.0, we can use the catalog to store our stream table source and sink
      for Redis connector, it should exist a Redis table sink so we can register it to catalog, and use Redis as a table in SQL environment

      Redis redis = new Redis()
                      .mode(RedisVadidator.REDIS_CLUSTER)
                      .command(RedisCommand.INCRBY_EX.name())
                      .ttl(100000)
                      .property(RedisVadidator.REDIS_NODES, REDIS_HOST+ ":" + REDIS_PORT);
      tableEnvironment
                      .connect(redis).withSchema(new Schema()
                      .field("k", TypeInformation.of(String.class))
                      .field("v", TypeInformation.of(Long.class)))
                      .registerTableSink("redis");
      tableEnvironment.sqlUpdate("insert into redis select k, v from t1");
      env.execute("Test Redis Table");
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yuemeng yuemeng
                Reporter:
                yuemeng yuemeng
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: