-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add unified table sink instantiation.
- Consolidate table sink and table source instantiation. - Add support to register a Calcite table with both tableSource and tableSink. - Add Insert command support in SQL client. - Add CsvTableSinkFactory.
- Loading branch information
Shuyi Chen
committed
Jun 22, 2018
1 parent
ae8cef3
commit a7ce69b
Showing
78 changed files
with
1,489 additions
and
369 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...k-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Sink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.table.client.config; | ||
|
||
import org.apache.flink.table.descriptors.DescriptorProperties; | ||
import org.apache.flink.table.descriptors.TableSinkDescriptor; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Configuration of a table sink. Parses an entry in the `tables` list of an environment | ||
* file and translates to table descriptor properties. | ||
*/ | ||
public class Sink extends TableSinkDescriptor { | ||
private String name; | ||
private Map<String, String> properties; | ||
|
||
protected Sink(String name, Map<String, String> properties) { | ||
this.name = name; | ||
this.properties = properties; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Map<String, String> getProperties() { | ||
return properties; | ||
} | ||
|
||
// -------------------------------------------------------------------------------------------- | ||
|
||
@Override | ||
public void addProperties(DescriptorProperties properties) { | ||
this.properties.forEach(properties::putString); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...aries/flink-sql-client/src/main/java/org/apache/flink/table/client/config/SourceSink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.table.client.config; | ||
|
||
import org.apache.flink.table.descriptors.TableDescriptor; | ||
import org.apache.flink.table.descriptors.TableDescriptorValidator; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Common class for all descriptors describing a table source and sink together. | ||
*/ | ||
public class SourceSink extends TableDescriptor { | ||
private String name; | ||
private Map<String, String> properties; | ||
|
||
protected SourceSink(String name, Map<String, String> properties) { | ||
this.name = name; | ||
this.properties = properties; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Map<String, String> getProperties() { | ||
return properties; | ||
} | ||
|
||
public Source toSource() { | ||
final Map<String, String> newProperties = new HashMap<>(properties); | ||
newProperties.replace(TableDescriptorValidator.TABLE_TYPE(), | ||
TableDescriptorValidator.TABLE_TYPE_VALUE_SOURCE()); | ||
return new Source(name, newProperties); | ||
} | ||
|
||
public Sink toSink() { | ||
final Map<String, String> newProperties = new HashMap<>(properties); | ||
newProperties.replace(TableDescriptorValidator.TABLE_TYPE(), | ||
TableDescriptorValidator.TABLE_TYPE_VALUE_SINK()); | ||
return new Sink(name, newProperties); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.