flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-9059) Add support for unified table source and sink declaration in environment file
Date Fri, 30 Mar 2018 17:34:00 GMT

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

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

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

    https://github.com/apache/flink/pull/5758#discussion_r178334028
  
    --- Diff: flink-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
---
    @@ -29,38 +30,47 @@
     
     /**
      * Environment configuration that represents the content of an environment file. Environment
files
    - * define sources, execution, and deployment behavior. An environment might be defined
by default or
    + * define tables, execution, and deployment behavior. An environment might be defined
by default or
      * as part of a session. Environments can be merged or enriched with properties (e.g.
from CLI command).
      *
      * <p>In future versions, we might restrict the merging or enrichment of deployment
properties to not
      * allow overwriting of a deployment by a session.
      */
     public class Environment {
     
    -	private Map<String, Source> sources;
    +	private Map<String, TableDescriptor> tables;
     
     	private Execution execution;
     
     	private Deployment deployment;
     
     	public Environment() {
    -		this.sources = Collections.emptyMap();
    +		this.tables = Collections.emptyMap();
     		this.execution = new Execution();
     		this.deployment = new Deployment();
     	}
     
    -	public Map<String, Source> getSources() {
    -		return sources;
    +	public Map<String, TableDescriptor> getTables() {
    +		return tables;
     	}
     
    -	public void setSources(List<Map<String, Object>> sources) {
    -		this.sources = new HashMap<>(sources.size());
    -		sources.forEach(config -> {
    -			final Source s = Source.create(config);
    -			if (this.sources.containsKey(s.getName())) {
    -				throw new SqlClientException("Duplicate source name '" + s + "'.");
    +	public void setTables(List<Map<String, Object>> tables) {
    +		this.tables = new HashMap<>(tables.size());
    +		tables.forEach(config -> {
    +			if (!config.containsKey(TableDescriptor.TABLE_TYPE())) {
    +				throw new SqlClientException("The 'type' attribute of a table is missing.");
    --- End diff --
    
    Got it, so `both` should probably be added here once `sink` type is supported in FLINK-8866.
Thanks for the clarification.


> Add support for unified table source and sink declaration in environment file
> -----------------------------------------------------------------------------
>
>                 Key: FLINK-9059
>                 URL: https://issues.apache.org/jira/browse/FLINK-9059
>             Project: Flink
>          Issue Type: Task
>          Components: Table API &amp; SQL
>            Reporter: Shuyi Chen
>            Assignee: Shuyi Chen
>            Priority: Major
>             Fix For: 1.5.0
>
>
> 1) Add a common property called "type" with single value 'source'.
> 2) in yaml file, replace "sources" with "tables".



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

Mime
View raw message