-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Flink: Upgrade version from 1.11.0 to 1.12.1 #1956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
75f0b00
upgrade flink version from 1.11.0 to 1.12.0
60b4392
only create table env once and close the table result itertor in Test…
1af9e61
disable CoreOptions.CHECK_LEAKED_CLASSLOADER for FlinkTestBase
ed59526
use try-with-resources statement for collecting table result
b1289ea
update TestFlinkTableSourc with Flink 1.12 upgrade as the behavior ch…
f9f81e4
update Flink version from 1.12.0 to 1.12.1
94dab69
address the review comments
39a6fef
fix javadoc
744a827
create our own MiniClusterBase class that disable classloader check, …
b05c00e
enable TestFlinkCatalogTable#testCreateTableIfNotExists now we are on…
b5ce948
Address latest review comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
45 changes: 45 additions & 0 deletions
45
flink/src/main/java/org/apache/iceberg/flink/util/FlinkCompatibilityUtil.java
This file contains hidden or 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,45 @@ | ||
| /* | ||
| * 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.iceberg.flink.util; | ||
|
|
||
| import org.apache.flink.api.common.typeinfo.TypeInformation; | ||
| import org.apache.flink.table.api.TableColumn; | ||
| import org.apache.flink.table.data.RowData; | ||
| import org.apache.flink.table.runtime.typeutils.InternalTypeInfo; | ||
| import org.apache.flink.table.types.logical.RowType; | ||
|
|
||
| /** | ||
| * This is a small util class that try to hide calls to Flink | ||
| * Internal or PublicEvolve interfaces as Flink can change | ||
| * those APIs during minor version release. | ||
| */ | ||
| public class FlinkCompatibilityUtil { | ||
|
|
||
| private FlinkCompatibilityUtil() { | ||
| } | ||
|
|
||
| public static TypeInformation<RowData> toTypeInfo(RowType rowType) { | ||
| return InternalTypeInfo.of(rowType); | ||
| } | ||
|
|
||
| public static boolean isPhysicalColumn(TableColumn column) { | ||
| return column.isPhysical(); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
57 changes: 57 additions & 0 deletions
57
flink/src/test/java/org/apache/iceberg/flink/MiniClusterResource.java
This file contains hidden or 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,57 @@ | ||
| /* | ||
| * 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.iceberg.flink; | ||
|
|
||
| import org.apache.flink.configuration.Configuration; | ||
| import org.apache.flink.configuration.CoreOptions; | ||
| import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration; | ||
| import org.apache.flink.test.util.MiniClusterWithClientResource; | ||
|
|
||
| public class MiniClusterResource { | ||
|
|
||
| private static final int DEFAULT_TM_NUM = 1; | ||
| private static final int DEFAULT_PARALLELISM = 4; | ||
|
|
||
| public static final Configuration DISABLE_CLASSLOADER_CHECK_CONFIG = new Configuration() | ||
| // disable classloader check as Avro may cache class/object in the serializers. | ||
| .set(CoreOptions.CHECK_LEAKED_CLASSLOADER, false); | ||
|
|
||
| private MiniClusterResource() { | ||
|
|
||
| } | ||
|
|
||
| /** | ||
| * It will start a mini cluster with classloader.check-leaked-classloader=false, | ||
| * so that we won't break the unit tests because of the class loader leak issue. | ||
| * In our iceberg integration tests, there're some that will assert the results | ||
| * after finished the flink jobs, so actually we may access the class loader | ||
| * that has been closed by the flink task managers if we enable the switch | ||
| * classloader.check-leaked-classloader by default. | ||
| */ | ||
| public static MiniClusterWithClientResource createWithClassloaderCheckDisabled() { | ||
| return new MiniClusterWithClientResource( | ||
| new MiniClusterResourceConfiguration.Builder() | ||
| .setNumberTaskManagers(DEFAULT_TM_NUM) | ||
| .setNumberSlotsPerTaskManager(DEFAULT_PARALLELISM) | ||
| .setConfiguration(DISABLE_CLASSLOADER_CHECK_CONFIG) | ||
| .build()); | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this.