-
Notifications
You must be signed in to change notification settings - Fork 988
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
[iceberg] Introduce feature to migrate table from iceberg to paimon #4639
base: master
Are you sure you want to change the base?
Conversation
Please write [WIP] in PR title. |
7e6b49f
to
898eed1
Compare
this.paimonCatalog = paimonCatalog; | ||
this.paimonFileIO = paimonCatalog.fileIO(); | ||
this.paimonDatabaseName = paimonDatabaseName; | ||
this.paimonTableNameame = paimonTableNameame; |
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.
this.paimonTableNameame = paimonTableNameame; | |
this.paimonTableName = paimonTableName; |
Schema paimonSchema = icebergSchemaToPaimonSchema(icebergMetadata); | ||
Identifier paimonIdentifier = Identifier.create(paimonDatabaseName, paimonTableNameame); | ||
|
||
paimonCatalog.createDatabase(paimonDatabaseName, false); |
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.
Why false? User must migrate to a non-existing database?
|
||
private List<IcebergManifestFileMeta> checkAndFilterManifestFiles( | ||
List<IcebergManifestFileMeta> icebergManifestFileMetas) { | ||
if (!ignoreDelete) { |
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.
Why do we need such an option? If there are deletion vectors in Iceberg, and user uses this option, then the resulting data will be incorrect. Incorrect data are useless to the users.
@@ -190,6 +199,70 @@ private static Object toTypeObject(DataType dataType, int fieldId, int depth) { | |||
} | |||
} | |||
|
|||
public DataType getDataType() { |
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.
This class already has a dataType
member. Check if dataType
is null, if not just return that object, otherwise calculate data type from type
string.
# Conflicts: # paimon-core/src/main/java/org/apache/paimon/iceberg/metadata/IcebergDataField.java
…ain metadata path
…tead from iceberg catalog # Conflicts: # paimon-core/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory
cfa7ae2
to
a6fdc51
Compare
Purpose
Linked issue: close #xxx
Paimon has supported generating Iceberg compatible metadata, so that paimon tables can be consumed directly by Iceberg readers. Now paimon try to support an action or a procedure to support migrating iceberg table to paimon table.
The general implementation idea of this feature includes the following steps:
This pr supports basic ability to migrating iceberg table to paimon, including:
Procedure or action is not included in this pr.
Tests
org.apache.paimon.iceberg.IcebergMigrateTest
API and Format
Documentation