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

fix: reintroduce FetchFieldFromStruct as a public UDF #4185

Merged
merged 1 commit into from
Dec 23, 2019

Conversation

agavra
Copy link
Contributor

@agavra agavra commented Dec 23, 2019

Description

When upgrading from 5.3->5.4 commands that were already written into the command topic would fail with "Cannot find function FETCH_FEILD_FROM_STRCUT". The reason is that we made structs stop rewriting with that UDF and instead inlined it's usage and prevent people from using that function externally. This re-introduces the change into 5.4. so that upgrades are possible.

NOTE: This will not be merged to master and master will be considered a breaking upgrade from 5.4

Testing done

  • verified the problem by running 5.3 and issuing a command with struct access
  • upgraded to 5.4 and checked if it can recover; before this fix it cannot and after it can

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@apurvam
Copy link
Contributor

apurvam commented Dec 23, 2019

Here is the PR which removed FETCH_FIELD_FROM_STRUCT #3639

Copy link
Contributor

@apurvam apurvam left a comment

Choose a reason for hiding this comment

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

This looks good to me overall The handling of FETCH_FIELD_FROM_STRUCT looks totally special cased though. Would be good to understand why that is the preferred approach.

@agavra
Copy link
Contributor Author

agavra commented Dec 23, 2019

@apurvam - it was always special cased because unlike normal UDFs, FETCH_FIELD_FROM_STRUCT does not have a deterministic return type. The code introduced in this PR is manually cherry-picked (inverse) from #3639 (plus some additional tests)

Copy link
Contributor

@apurvam apurvam left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@stevenpyzhang stevenpyzhang left a comment

Choose a reason for hiding this comment

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

LGTM thanks for the fix @agavra

@agavra agavra merged commit a50a665 into confluentinc:5.4.x Dec 23, 2019
@agavra agavra deleted the fffs branch December 23, 2019 19:53
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.

None yet

3 participants