-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Storage] Expose Kernel schema in metadata API #6716
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
|
|
||
| import io.delta.kernel.internal.actions.Metadata; | ||
| import io.delta.kernel.internal.util.VectorUtils; | ||
| import io.delta.kernel.types.StructType; | ||
| import io.delta.storage.commit.actions.AbstractMetadata; | ||
| import java.util.*; | ||
|
|
||
|
|
@@ -58,6 +59,11 @@ public Map<String, String> getFormatOptions() { | |
| return Collections.unmodifiableMap(kernelMetadata.getFormat().getOptions()); | ||
| } | ||
|
|
||
| @Override | ||
| public StructType getSchema() { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you plan to use this io.delta.kernel.unitycatalog.adapters.MetadataAdapter in Delta Storage and Spark?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no. and im pretty sure we cant do that either.
|
||
| return kernelMetadata.getSchema(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getSchemaString() { | ||
| return kernelMetadata.getSchemaString(); | ||
|
|
||
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.
I don't know why Kernel API can't be dependency without shading.
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.
yeah i tried just doing
storage.dependsOn(kernelApi)but it ran into problems. here's the story:becomes:
this way Kernel does not fight with Spark/Hadoop/other libraries that may use different Jackson versions.
.dependsOn(kernelApi)does not use Kernel’s final shaded jar. It uses Kernel’s raw compiled class directory.That raw class directory still references:
Java sees those as totally different classes. So this failed:
Fix:
Instead of:
we make storage compile against Kernel’s final shaded jar:
And we still add delta-kernel-api to the published POM, so external users get the normal dependency.