Derby
  1. Derby
  2. DERBY-5635

Provide implementation for getMetaData() in VTITemplate

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.9.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      VTITemplate defines getMetaData() as an abstract method. That method doesn't appear to be needed for user-defined table functions, so it would be good to provide a default implementation (could just throw an exception) so that less boilerplate is needed when writing table functions. The method does however get used by system VTIs, which is probably why it was made abstract in the first place. The system VTIs should still override getMetaData().

      1. d5635.diff
        5 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Thanks, Rick. Committed revision 1297396.

        Show
        Knut Anders Hatlen added a comment - Thanks, Rick. Committed revision 1297396.
        Hide
        Rick Hillegas added a comment -

        Sounds like a good improvement to me, Knut. +1. Thanks.

        Show
        Rick Hillegas added a comment - Sounds like a good improvement to me, Knut. +1. Thanks.
        Hide
        Knut Anders Hatlen added a comment -

        Attaching a patch that removes the abstract method getMetaData() from VTITemplate so that it instead inherits the getMetaData() method from its base class (VTITemplateBase). The method in VTITemplateBase throws a not-implemented exception.

        The patch also removes the getMetaData() implementations from VTITemplate's sub-classes StringColumnVTI, StringArrayVTI and SampleVTI, so that those classes also inherit the method from VTITemplateBase. The removed implementations either returned null or threw an exception, and could safely be replaced by VTITemplateBase's default implementation since they're never called.

        The getMetaData() methods in the system VTIs are preserved, since they are actually used.

        All the regression tests ran cleanly with the patch.

        Show
        Knut Anders Hatlen added a comment - Attaching a patch that removes the abstract method getMetaData() from VTITemplate so that it instead inherits the getMetaData() method from its base class (VTITemplateBase). The method in VTITemplateBase throws a not-implemented exception. The patch also removes the getMetaData() implementations from VTITemplate's sub-classes StringColumnVTI, StringArrayVTI and SampleVTI, so that those classes also inherit the method from VTITemplateBase. The removed implementations either returned null or threw an exception, and could safely be replaced by VTITemplateBase's default implementation since they're never called. The getMetaData() methods in the system VTIs are preserved, since they are actually used. All the regression tests ran cleanly with the patch.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development