Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6476

Table environment register row data stream

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 1.4.0
    • Component/s: Table API & SQL
    • Labels:
    • Environment:

      java/scala

      Description

      Registering as table source streams with Row is currently not possible:

      Java:

      DataStream<Row> ds = ...
      tableEnv.registerDataStream("MyTableRow", ds, "a, b, c ...");

      org.apache.flink.table.api.TableException: Source of type Row(f0: Integer, f1: Long, f2: Integer, f3: String, f4: Integer) cannot be converted into Table.
      at org.apache.flink.table.api.TableEnvironment.getFieldInfo(TableEnvironment.scala:680)
      at org.apache.flink.table.api.StreamTableEnvironment.registerDataStreamInternal(StreamTableEnvironment.scala:363)
      at org.apache.flink.table.api.java.StreamTableEnvironment.registerDataStream(StreamTableEnvironment.scala:133)
      at org.apache.flink.table.api.java.stream.sql.SqlITCase.testRow2(SqlITCase.java:92)

      Scala:

      val ds:DataStream[Row] = ...
      tableEnv.registerDataStream("MyTableRow", ds, "a, b, c, d, e");

      org.apache.flink.api.java.typeutils.GenericTypeInfo cannot be cast to org.apache.flink.api.common.typeutils.CompositeType

      This can be supported by extending the in the org.apache.flink.table.api.TableEnvironment

      getFieldInfo()

      and by constructing the StreamTableSource correspondingly

        Attachments

          Activity

            People

            • Assignee:
              rtudoran radu
              Reporter:
              rtudoran radu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: