Repository navigation
Fix OAuth profile type option key mismatch - #866
Conversation
The Spark option key for profile type was `shareCredentialsType`, but the JSON deserializer in DeltaSharingProfileDeserializer reads the `type` field. This caused OAuth profiles set via Spark options to silently fall back to bearer_token, failing with "bearer_token only supports version 1". Rename the option from `shareCredentialsType` to `type` so the key matches the JSON field name used by .share profile files and the deserializer.
|
|
||
| val PROFILE_SHARE_CREDENTIALS_VERSION = "shareCredentialsVersion" | ||
| val PROFILE_TYPE = "shareCredentialsType" | ||
| val PROFILE_TYPE = "type" |
There was a problem hiding this comment.
remind me why shareCredentialsType doesn't work?
There was a problem hiding this comment.
The deserializer is using "type": https://github.com/delta-io/delta-sharing/blob/main/client/src/main/scala/io/delta/sharing/client/DeltaSharingProfileProvider.scala#L98
There was a problem hiding this comment.
then the question becomes: do we have testing cover the while workflow?
There was a problem hiding this comment.
My new tests in this PR should cover the deserialize path.
But I don't think we have e2e test for OAuth sharing, as OAuth sharing is O2D only. Our server doesn't support OAuth.
There was a problem hiding this comment.
If we were designing this from scratch without type support in the share profile, I would prefer shareCredentialsType, since type is a bit vague about what it refers to. However, itâs too late to make that change now. To keep things consistent, I think using type at this point is the right move.
There was a problem hiding this comment.
the other options is to add more logic for supporting shareCredentialsType in https://github.com/delta-io/delta-sharing/blob/main/client/src/main/scala/io/delta/sharing/client/DeltaSharingProfileProvider.scala#L98
but then it means spark options will be diverging from the options in the share profile file.
There was a problem hiding this comment.
Yeah, we probably want to follow the same pattern. Using "type" is ok as we understand it's within profile scope.
The Spark option key for profile type was
shareCredentialsType, but the JSON deserializer in DeltaSharingProfileDeserializer reads thetypefield: https://github.com/delta-io/delta-sharing/blob/main/client/src/main/scala/io/delta/sharing/client/DeltaSharingProfileProvider.scala#L98This caused OAuth profiles set via Spark options to silently fall back to bearer_token, failing with "bearer_token only supports version 1".
Rename the option from
shareCredentialsTypetotypeso the key matches the JSON field name used by .share profile files and the deserializer.