Github user walterddr commented on a diff in the pull request:
https://github.com/apache/flink/pull/5758#discussion_r177828794
--- 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 --
Just curious, any chance we need to have a Table to be both `source` and
`sink` type. (e.g. similar to queryable state, if user wants to maintain
explicitly a table for that purpose)
---