Skip to content
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

Kernel: Add a conversion utility to convert Iceberg schema to Delta schema #4075

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amogh-jahagirdar
Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar commented Jan 20, 2025

This change adds a icebergToDeltaSchema util function to SchemaUtils which converts an Iceberg Schema to a Delta schema.

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • [ X] Kernel
  • Other (fill in here)

Description

This change adds a icebergToDeltaSchema util function to SchemaUtils which converts an Iceberg Schema to a Delta schema. The utility function should be a part of kernel to enable any consumers of kernel to be able to do this kind of metadata conversion.

How was this patch tested?

Added unit tests.

Does this PR introduce any user-facing changes?

New utility API added

Comment on lines +392 to +398
This product includes code from Apache Iceberg.

* io.delta.kernel.internal.util.IcebergTypeToStructType visitor implementation based on org.apache.iceberg.spark.TypeToSparkType

Copyright: 2018-2024 The Apache Software Foundation
Home page: https://iceberg.apache.org/
License: https://www.apache.org/licenses/LICENSE-2.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to make sure this attribution is done correctly

Comment on lines +23 to +24
Apache Iceberg
Copyright 2017-2024 The Apache Software Foundation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, I think this change to the notice is correct, currently the kernel module doesn't have its own License/Notice so I added this to the root level.

@amogh-jahagirdar amogh-jahagirdar force-pushed the iceberg-to-delta-schema-util branch from d04e988 to ea5d869 Compare January 20, 2025 19:37
Comment on lines +580 to +581
"org.apache.iceberg" % "iceberg-api" % "1.6.1",
"org.apache.iceberg" % "iceberg-core" % "1.6.1",
Copy link
Contributor Author

@amogh-jahagirdar amogh-jahagirdar Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't use 1.7.1 at the moment because Delta only builds with JDK 8 at the moment as far as I can tell, with the exception of Spark master which is using JDk 17 (spark 4.0 requires JDK 11+)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant