Github user fhueske commented on the issue:

    https://github.com/apache/flink/pull/3829
  
    Thanks for the reply @lincoln-lil.
    
    I agree, it is possible that a `TableSink` defines its schema when it is 
created instead of when it is configured by the optimizer. However, I think 
mixing these modes obfuscates the interface and means that the way how a 
`TableSink` can be used (with registration or without) depends on its 
implementation. IMO, a (correctly implemented) `TableSink` should be usable at 
any place where it can be passed to the Table API. From my point of view mixing 
both modes in the same interface would be bad API design. Actually, I think the 
registration mode of defining the schema before is very valuable because it 
ensures that the output of the query has a correct schema.
    
    Regarding the method of how to specify the query, I'm very much in favor of 
providing a separate method. I don't care so much about the name, `sqlInsert()` 
is just a proposal. However, I think the usage of a  `SELECT` query is 
completely different from an `INSERT INTO SELECT` query. This is reflected by 
the different return type and the need to provide a `QueryConfig`.
    
    Best, Fabian


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to