Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
46a950df
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
46a950df
编写于
2月 10, 2017
作者:
S
shijinkui
提交者:
Fabian Hueske
4月 21, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-4562] [table] Move table examples into a dedicated module in flink-examples.
This closes #2460.
上级
83061ad0
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
124 addition
and
14 deletion
+124
-14
flink-dist/pom.xml
flink-dist/pom.xml
+1
-0
flink-examples/flink-examples-table/pom.xml
flink-examples/flink-examples-table/pom.xml
+108
-0
flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
...va/org/apache/flink/table/examples/java/WordCountSQL.java
+2
-2
flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/WordCountTable.java
.../org/apache/flink/table/examples/java/WordCountTable.java
+2
-2
flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/StreamSQLExample.scala
.../apache/flink/table/examples/scala/StreamSQLExample.scala
+1
-1
flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/StreamTableExample.scala
...pache/flink/table/examples/scala/StreamTableExample.scala
+1
-2
flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/TPCHQuery3Table.scala
...g/apache/flink/table/examples/scala/TPCHQuery3Table.scala
+0
-0
flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountSQL.scala
.../org/apache/flink/table/examples/scala/WordCountSQL.scala
+0
-0
flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountTable.scala
...rg/apache/flink/table/examples/scala/WordCountTable.scala
+0
-0
flink-examples/pom.xml
flink-examples/pom.xml
+1
-0
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/table/AggregationsITCase.scala
...link/table/api/scala/batch/table/AggregationsITCase.scala
+8
-7
未找到文件。
flink-dist/pom.xml
浏览文件 @
46a950df
...
...
@@ -338,6 +338,7 @@ under the License.
<excludes>
<exclude>
org.apache.flink:flink-examples-batch
</exclude>
<exclude>
org.apache.flink:flink-examples-streaming
</exclude>
<exclude>
org.apache.flink:flink-examples-table
</exclude>
<exclude>
org.apache.flink:flink-python
</exclude>
<exclude>
org.slf4j:slf4j-log4j12
</exclude>
<exclude>
log4j:log4j
</exclude>
...
...
flink-examples/flink-examples-table/pom.xml
0 → 100644
浏览文件 @
46a950df
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.apache.flink
</groupId>
<artifactId>
flink-examples_2.10
</artifactId>
<version>
1.3-SNAPSHOT
</version>
<relativePath>
..
</relativePath>
</parent>
<name>
flink-examples-table
</name>
<artifactId>
flink-examples-table_2.10
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
org.apache.flink
</groupId>
<artifactId>
flink-table_2.10
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
net.alchim31.maven
</groupId>
<artifactId>
scala-maven-plugin
</artifactId>
<executions>
<execution>
<id>
scala-compile-first
</id>
<phase>
process-resources
</phase>
<goals>
<goal>
add-source
</goal>
<goal>
compile
</goal>
</goals>
</execution>
<execution>
<id>
scala-test-compile
</id>
<phase>
process-test-resources
</phase>
<goals>
<goal>
testCompile
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-shade-plugin
</artifactId>
<executions>
<execution>
<id>
flink-table-examples_2.10
</id>
<phase>
package
</phase>
<goals>
<goal>
shade
</goal>
</goals>
<configuration>
<shadeTestJar>
false
</shadeTestJar>
<shadedArtifactAttached>
false
</shadedArtifactAttached>
<createDependencyReducedPom>
false
</createDependencyReducedPom>
<finalName>
TableExamples
</finalName>
<outputFile>
flink-examples-table-with-dependencies.jar
</outputFile>
<filters>
<filter>
<artifact>
*:*
</artifact>
<includes>
<include>
org.codehaus.commons.compiler.properties
</include>
<include>
org/codehaus/janino/**
</include>
<include>
org/codehaus/commons/**
</include>
<include>
org/apache/calcite/**
</include>
<include>
org/apache/flink/table/**
</include>
<include>
org/apache/flink/shaded/calcite/com/google/common/**
</include>
<include>
org/apache/flink/shaded/calcite/org/eigenbase/util/property/**
</include>
</includes>
<excludes>
<exclude>
META-INF/*.SF
</exclude>
<exclude>
META-INF/*.DSA
</exclude>
<exclude>
META-INF/*.RSA
</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
flink-
libraries/flink
-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
→
flink-
examples/flink-examples
-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
浏览文件 @
46a950df
...
...
@@ -17,11 +17,11 @@
*/
package
org.apache.flink.table.examples.java
;
import
org.apache.flink.table.api.Table
;
import
org.apache.flink.api.java.DataSet
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.table.api.
java.BatchTableEnvironment
;
import
org.apache.flink.table.api.
Table
;
import
org.apache.flink.table.api.TableEnvironment
;
import
org.apache.flink.table.api.java.BatchTableEnvironment
;
/**
* Simple example that shows how the Batch SQL API is used in Java.
...
...
flink-
libraries/flink
-table/src/main/java/org/apache/flink/table/examples/java/WordCountTable.java
→
flink-
examples/flink-examples
-table/src/main/java/org/apache/flink/table/examples/java/WordCountTable.java
浏览文件 @
46a950df
...
...
@@ -17,11 +17,11 @@
*/
package
org.apache.flink.table.examples.java
;
import
org.apache.flink.table.api.Table
;
import
org.apache.flink.api.java.DataSet
;
import
org.apache.flink.api.java.ExecutionEnvironment
;
import
org.apache.flink.table.api.
java.BatchTableEnvironment
;
import
org.apache.flink.table.api.
Table
;
import
org.apache.flink.table.api.TableEnvironment
;
import
org.apache.flink.table.api.java.BatchTableEnvironment
;
/**
* Simple example for demonstrating the use of the Table API for a Word Count in Java.
...
...
flink-
libraries/flink
-table/src/main/scala/org/apache/flink/table/examples/scala/StreamSQLExample.scala
→
flink-
examples/flink-examples
-table/src/main/scala/org/apache/flink/table/examples/scala/StreamSQLExample.scala
浏览文件 @
46a950df
...
...
@@ -18,9 +18,9 @@
package
org.apache.flink.table.examples.scala
import
org.apache.flink.api.scala._
import
org.apache.flink.table.api.scala._
import
org.apache.flink.streaming.api.scala.
{
DataStream
,
StreamExecutionEnvironment
}
import
org.apache.flink.table.api.TableEnvironment
import
org.apache.flink.table.api.scala._
/**
* Simple example for demonstrating the use of SQL on a Stream Table.
...
...
flink-
libraries/flink
-table/src/main/scala/org/apache/flink/table/examples/scala/StreamTableExample.scala
→
flink-
examples/flink-examples
-table/src/main/scala/org/apache/flink/table/examples/scala/StreamTableExample.scala
浏览文件 @
46a950df
...
...
@@ -18,9 +18,9 @@
package
org.apache.flink.table.examples.scala
import
org.apache.flink.api.scala._
import
org.apache.flink.table.api.scala._
import
org.apache.flink.streaming.api.scala.
{
DataStream
,
StreamExecutionEnvironment
}
import
org.apache.flink.table.api.TableEnvironment
import
org.apache.flink.table.api.scala._
/**
* Simple example for demonstrating the use of Table API on a Stream Table.
...
...
@@ -28,7 +28,6 @@ import org.apache.flink.table.api.TableEnvironment
* This example shows how to:
* - Convert DataStreams to Tables
* - Apply union, select, and filter operations
*
*/
object
StreamTableExample
{
...
...
flink-
libraries/flink
-table/src/main/scala/org/apache/flink/table/examples/scala/TPCHQuery3Table.scala
→
flink-
examples/flink-examples
-table/src/main/scala/org/apache/flink/table/examples/scala/TPCHQuery3Table.scala
浏览文件 @
46a950df
文件已移动
flink-
libraries/flink
-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountSQL.scala
→
flink-
examples/flink-examples
-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountSQL.scala
浏览文件 @
46a950df
文件已移动
flink-
libraries/flink
-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountTable.scala
→
flink-
examples/flink-examples
-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountTable.scala
浏览文件 @
46a950df
文件已移动
flink-examples/pom.xml
浏览文件 @
46a950df
...
...
@@ -68,5 +68,6 @@ under the License.
<modules>
<module>
flink-examples-batch
</module>
<module>
flink-examples-streaming
</module>
<module>
flink-examples-table
</module>
</modules>
</project>
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/table/AggregationsITCase.scala
浏览文件 @
46a950df
...
...
@@ -25,7 +25,6 @@ import org.apache.flink.table.api.scala._
import
org.apache.flink.api.scala.util.CollectionDataSets
import
org.apache.flink.types.Row
import
org.apache.flink.table.api.TableEnvironment
import
org.apache.flink.table.examples.scala.WordCountTable.
{
WC
=>
MyWC
}
import
org.apache.flink.test.util.TestBaseUtils
import
org.junit._
import
org.junit.runner.RunWith
...
...
@@ -156,17 +155,17 @@ class AggregationsITCase(
val
tEnv
=
TableEnvironment
.
getTableEnvironment
(
env
,
config
)
val
input
=
env
.
fromElements
(
My
WC
(
"hello"
,
1
),
My
WC
(
"hello"
,
1
),
My
WC
(
"ciao"
,
1
),
My
WC
(
"hola"
,
1
),
My
WC
(
"hola"
,
1
))
WC
(
"hello"
,
1
),
WC
(
"hello"
,
1
),
WC
(
"ciao"
,
1
),
WC
(
"hola"
,
1
),
WC
(
"hola"
,
1
))
val
expr
=
input
.
toTable
(
tEnv
)
val
result
=
expr
.
groupBy
(
'word
)
.
select
(
'word
,
'frequency
.
sum
as
'frequency
)
.
filter
(
'frequency
===
2
)
.
toDataSet
[
My
WC
]
.
toDataSet
[
WC
]
val
mappedResult
=
result
.
map
(
w
=>
(
w
.
word
,
w
.
frequency
*
10
)).
collect
()
val
expected
=
"(hello,20)\n"
+
"(hola,20)"
...
...
@@ -339,4 +338,6 @@ class AggregationsITCase(
val
results
=
t
.
toDataSet
[
Row
].
collect
()
TestBaseUtils
.
compareResultAsText
(
results
.
asJava
,
expected
)
}
case
class
WC
(
word
:
String
,
frequency
:
Long
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录