You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ja...@apache.org on 2019/07/25 13:55:41 UTC

[flink] 02/02: [FLINK-13116][table-planner-blink] Exclude RAT for explain and digest resource files

This is an automated email from the ASF dual-hosted git repository.

jark pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 9cd95930bc89c2a4d4e8ee5b7e0c7394eca22b73
Author: Jark Wu <im...@gmail.com>
AuthorDate: Thu Jul 25 20:29:16 2019 +0800

    [FLINK-13116][table-planner-blink] Exclude RAT for explain and digest resource files
---
 .../planner/catalog/CatalogStatisticsTest.java     |  2 +-
 .../digest/testGetDigestWithDynamicFunction.out    | 17 -----------------
 .../testGetDigestWithDynamicFunctionView.out       | 17 -----------------
 .../{ => explain}/testGetStatsFromCatalog.out      | 17 -----------------
 .../flink/table/planner/utils/TableTestBase.scala  | 22 +---------------------
 pom.xml                                            |  2 ++
 6 files changed, 4 insertions(+), 73 deletions(-)

diff --git a/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogStatisticsTest.java b/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogStatisticsTest.java
index 0049e9f..7bd6632 100644
--- a/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogStatisticsTest.java
+++ b/flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/catalog/CatalogStatisticsTest.java
@@ -76,7 +76,7 @@ public class CatalogStatisticsTest {
 		Table table = tEnv.sqlQuery("select * from T1, T2 where T1.s3 = T2.s3");
 		String result = tEnv.explain(table);
 		// T1 is broadcast side
-		String expected = TableTestUtil.readFromResource("/testGetStatsFromCatalog.out");
+		String expected = TableTestUtil.readFromResource("/explain/testGetStatsFromCatalog.out");
 		assertEquals(expected, TableTestUtil.replaceStageId(result));
 	}
 
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out
index ce5f0cd..ac3b44b 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out
+++ b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out
@@ -1,20 +1,3 @@
-/*
- * 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.
- */
 LogicalIntersect(all=[false],rowType=[RecordType(INTEGER random)])
 LogicalIntersect(all=[false],rowType=[RecordType(INTEGER random)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out
index 52e47ee..c965d30 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out
+++ b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out
@@ -1,20 +1,3 @@
-/*
- * 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.
- */
 LogicalIntersect(all=[false],rowType=[RecordType(INTEGER random)])
 LogicalIntersect(all=[false],rowType=[RecordType(INTEGER random)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/testGetStatsFromCatalog.out b/flink-table/flink-table-planner-blink/src/test/resources/explain/testGetStatsFromCatalog.out
similarity index 67%
rename from flink-table/flink-table-planner-blink/src/test/resources/testGetStatsFromCatalog.out
rename to flink-table/flink-table-planner-blink/src/test/resources/explain/testGetStatsFromCatalog.out
index 7798738..bc53a0a 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/testGetStatsFromCatalog.out
+++ b/flink-table/flink-table-planner-blink/src/test/resources/explain/testGetStatsFromCatalog.out
@@ -1,20 +1,3 @@
-/*
- * 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.
- */
 == Abstract Syntax Tree ==
 LogicalProject(b1=[$0], l2=[$1], s3=[$2], d4=[$3], dd5=[$4], b10=[$5], l20=[$6], s30=[$7], d40=[$8], dd50=[$9])
 +- LogicalFilter(condition=[=($2, $7)])
diff --git a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala
index 50f393f..672a71e 100644
--- a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala
+++ b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala
@@ -1067,27 +1067,7 @@ object TableTestUtil {
 
   def readFromResource(path: String): String = {
     val inputStream = getClass.getResource(path).getFile
-    val fullContent = Source.fromFile(inputStream).mkString
-    val license =
-      """/*
-        | * 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.
-        | */
-        |""".stripMargin
-    fullContent.replace(license, "")
+    Source.fromFile(inputStream).mkString
   }
 
   /**
diff --git a/pom.xml b/pom.xml
index 3f7cd8b..ced31af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1334,6 +1334,8 @@ under the License.
 						<exclude>flink-formats/flink-avro/src/test/resources/avro/*.avsc</exclude>
 						<exclude>out/test/flink-avro/avro/user.avsc</exclude>
 						<exclude>flink-table/flink-table-planner/src/test/scala/resources/*.out</exclude>
+						<exclude>flink-table/flink-table-planner-blink/src/test/resources/digest/*.out</exclude>
+						<exclude>flink-table/flink-table-planner-blink/src/test/resources/explain/*.out</exclude>
 						<exclude>flink-yarn/src/test/resources/krb5.keytab</exclude>
 						<exclude>flink-end-to-end-tests/test-scripts/test-data/*</exclude>
 						<exclude>flink-end-to-end-tests/test-scripts/docker-hadoop-secure-cluster/config/keystore.jks</exclude>