[ 
https://issues.apache.org/jira/browse/FLINK-6476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16001451#comment-16001451
 ] 

ASF GitHub Bot commented on FLINK-6476:
---------------------------------------

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3849#discussion_r115339883
  
    --- Diff: 
flink-libraries/flink-table/src/test/java/org/apache/flink/table/api/java/stream/sql/SqlITCase.java
 ---
    @@ -30,11 +30,125 @@
     import org.apache.flink.streaming.util.StreamingMultipleProgramsTestBase;
     import org.apache.flink.table.api.java.stream.utils.StreamTestData;
     import org.junit.Test;
    +import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
    +import org.apache.flink.api.common.typeinfo.TypeInformation;
    +import org.apache.flink.api.java.typeutils.RowTypeInfo;
     
     import java.util.ArrayList;
     import java.util.List;
     
     public class SqlITCase extends StreamingMultipleProgramsTestBase {
    +   
    +   @Test
    +   public void testRowRegister() throws Exception {
    --- End diff --
    
    This feature should not be tested with (so many) expensive integration 
tests.
    Integration tests add a lot to the long build time and should be avoided if 
the feature can be tested with a more specific unit test. The 
`TableEnvironmentTest` has already many tests for `getFieldInfo`. We should add 
tests for `Row` there as well.


> Table environment register row data stream
> ------------------------------------------
>
>                 Key: FLINK-6476
>                 URL: https://issues.apache.org/jira/browse/FLINK-6476
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>         Environment: java/scala
>            Reporter: radu
>            Assignee: radu
>              Labels: feature, patch
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to