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

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

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

    https://github.com/apache/flink/pull/5662#discussion_r173879267
  
    --- Diff: 
flink-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaJsonTableSourceFactoryTestBase.java
 ---
    @@ -89,9 +94,10 @@ private void testTableSource(FormatDescriptor format) {
                // construct table source using a builder
     
                final Map<String, String> tableJsonMapping = new HashMap<>();
    +           tableJsonMapping.put("name", "name");
    --- End diff --
    
    Well, according to the current implementation, you are right. But I still 
feel uncomfortable about that since we actually mix the physical schema (format 
schema) and the logical schema (table schema) into the same map. Do you think 
it's necessary to make some changes here?


> Mapping of SchemaValidator.deriveFieldMapping() is incorrect.
> -------------------------------------------------------------
>
>                 Key: FLINK-8854
>                 URL: https://issues.apache.org/jira/browse/FLINK-8854
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; SQL
>    Affects Versions: 1.5.0
>            Reporter: Fabian Hueske
>            Assignee: Timo Walther
>            Priority: Blocker
>             Fix For: 1.5.0, 1.6.0
>
>
> The field mapping returned by {{SchemaValidator.deriveFieldMapping()}} is not 
> correct.
> It should not only include all fields of the table schema, but also all 
> fields of the format schema (mapped to themselves). Otherwise, it is not 
> possible to use a timestamp extractor on a field that is not in table schema. 
> For example this configuration would fail:
> {code}
> sources:
>   - name: TaxiRides
>     schema:
>       - name: rideId
>         type: LONG
>       - name: rowTime
>         type: TIMESTAMP
>         rowtime:
>           timestamps:
>             type: "from-field"
>             from: "rideTime"
>           watermarks:
>             type: "periodic-bounded"
>             delay: "60000"
>     connector:
>       ....
>     format:
>       property-version: 1
>       type: json
>       schema: "ROW(rideId LONG, rideTime TIMESTAMP)"
> {code}
> because {{rideTime}} is not in the table schema.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to