Skip to content

Add model validation to verify DbFunction's parameter types are mapped #13782

Description

@ajcvickers

See example in #13752. If I try to use this function, which is defined correctly but doesn't work, then all I get is the NotImplementedException. I get no info as to what happened that causes it not to be used.

Activity

  1. ajcvickers commented on Oct 29, 2018

    @ajcvickers
    ContributorAuthor

    Triage: Discussed this as a case where we might want to change when/if we drop down to client evaluation. Most cases where a DbFunction mapping is being made it is because there is a desire to translate it to SQL. Not giving feedback when a use of the mapping cannot be translated doesn't help people find what they are doing wrong. We could, for example, detect in model validation some cases where we will never translate.

  2. added this to the 3.0.0 milestone on Oct 29, 2018
  3. pmiddleton commented on Oct 30, 2018

    @pmiddleton
    Contributor

    There are two reasons a DbFunction won't translate. The first, as you found, is the inability to map a type for one of the parameters. The second reason is if the parameter is itself a function call which is not translatable. This can be because one of it's parameter types can't be mapped or it isn't a translatable function (DbFunction or builtin)

    You then end up having to go down the recursive rabbit hole until you work your way through all of the nested functions.

    I already have a set of unit tests defined in UdfDbFunctionSqlServerTests which test the various nesting/client eval scenarios and make sure translation is handled correctly. These all start with "Scalar_Nested_Function_". These can be leveraged and expanded to check for the warning messages once they are added.

  4. changed the title [-]No indication of why a function mapping is not used[/-] [+]Allow configuring facets of UDF parameters[/+] on Jan 16, 2019
  5. changed the title [-]Allow configuring facets of UDF parameters[/-] [+]Allow configuring typemapping of UDF parameters[/+] on Jan 16, 2019
  6. changed the title [-]Allow configuring typemapping of UDF parameters[/-] [+]Add model validation to verify DbFunction's parameter types are mapped[/+] on Jan 16, 2019
  7. removed this from the 3.0.0 milestone on Jan 16, 2019
  8. added this to the 3.0.0 milestone on Jan 18, 2019
  9. removed this from the 3.0.0 milestone on Mar 8, 2019
  10. 8 remaining items

  11. modified the milestones: 3.0.0, Backlog on May 10, 2019
  12. added 2 commits that reference this issue on Jun 21, 2019
    aa26dc0
    c2c05fc
  13. added a commit that references this issue on Jun 21, 2019
    7eb898a
  14. modified the milestones: Backlog, 3.0.0 on Jun 21, 2019
  15. modified the milestones: 3.0.0, on Jul 2, 2019
  16. modified the milestones: , 3.0.0 on Nov 11, 2019
  17. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions