Derby
  1. Derby
  2. DERBY-6127

Tell users to make sure that the state of a user-defined aggregate needs to be serializable

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.11.0.0, 10.10.2.0
    • Component/s: Documentation
    • Labels:
      None

      Description

      The Reference Manual section on "CREATE DERBY AGGREGATE statement" should tell users to make sure that all of the state of their user-defined aggregate is really serializable. This is because the Aggregator interface extends java.io.Serializable. A user-defined aggregate may end up being serialized to disk when performing grouped aggregation over a large number of groups. That is, intermediate results may be serialized to disk for a query like the following. The serialization will fail if the user-defined aggregate contains non-serializable fields:

      select a, myAggregate( b ) from myTable group by a

      1. DERBY-6127.diff
        3 kB
        Kim Haase
      2. DERBY-6127.stat
        0.1 kB
        Kim Haase
      3. DERBY-6127.zip
        5 kB
        Kim Haase

        Issue Links

          Activity

          Hide
          Kim Haase added a comment -

          Do you think anything needs to be said in the Developer's Guide topic too? (It's http://db.apache.org/derby/docs/10.10/devguide/cdevspecialuda.html.)

          Show
          Kim Haase added a comment - Do you think anything needs to be said in the Developer's Guide topic too? (It's http://db.apache.org/derby/docs/10.10/devguide/cdevspecialuda.html .)
          Hide
          Kim Haase added a comment -

          Here's another question, about this sentence:

          "A user-defined aggregate may end up being serialized to disk when performing grouped aggregation over a large number of groups."

          What is it that is performing the grouped aggregation? Does the aggregate itself do this, as the syntax suggests? Or is it a query that does it, or something else?

          Show
          Kim Haase added a comment - Here's another question, about this sentence: "A user-defined aggregate may end up being serialized to disk when performing grouped aggregation over a large number of groups." What is it that is performing the grouped aggregation? Does the aggregate itself do this, as the syntax suggests? Or is it a query that does it, or something else?
          Hide
          Rick Hillegas added a comment -

          Hi Kim,

          Yes, the Developer's Guide topic should probably mention this requirement.

          About your second question: Grouped aggregation is a task shared between Derby and the UDA. Derby is responsible for the grouping, that is, for dividing the rows into groups. The UDA is responsible for the aggregation, one row at a time.

          Thanks,
          -Rick

          Show
          Rick Hillegas added a comment - Hi Kim, Yes, the Developer's Guide topic should probably mention this requirement. About your second question: Grouped aggregation is a task shared between Derby and the UDA. Derby is responsible for the grouping, that is, for dividing the rows into groups. The UDA is responsible for the aggregation, one row at a time. Thanks, -Rick
          Hide
          Kim Haase added a comment -

          Thanks, Rick!

          Since it is the UDA that actually performs the aggregation, it looks like the sentence should read something like, "A user-defined aggregate may be serialized to disk when it performs grouped aggregation ..."

          Would that work?

          Show
          Kim Haase added a comment - Thanks, Rick! Since it is the UDA that actually performs the aggregation, it looks like the sentence should read something like, "A user-defined aggregate may be serialized to disk when it performs grouped aggregation ..." Would that work?
          Hide
          Rick Hillegas added a comment -

          Hi, Kim: Yes, that sounds right. Thanks.

          Show
          Rick Hillegas added a comment - Hi, Kim: Yes, that sounds right. Thanks.
          Hide
          Kim Haase added a comment -

          Thanks, Rick. Attaching DERBY-6127.diff, DERBY-6127.stat, and DERBY-6127.zip, with changes to the following:

          M src/ref/rrefsqljcreateaggregate.dita
          M src/devguide/cdevspecialuda.dita

          Thanks in advance for your feedback.

          Show
          Kim Haase added a comment - Thanks, Rick. Attaching DERBY-6127 .diff, DERBY-6127 .stat, and DERBY-6127 .zip, with changes to the following: M src/ref/rrefsqljcreateaggregate.dita M src/devguide/cdevspecialuda.dita Thanks in advance for your feedback.
          Hide
          Rick Hillegas added a comment -

          Hi Kim. These changes look great. +1. Thanks.

          Show
          Rick Hillegas added a comment - Hi Kim. These changes look great. +1. Thanks.
          Hide
          ASF subversion and git services added a comment -

          Commit 1522740 from Kim Haase in branch 'docs/trunk'
          [ https://svn.apache.org/r1522740 ]

          DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable

          Added paragraphs to a Reference Manual topic and a Developer's Guide topic.

          Patch: DERBY-6127.diff

          Show
          ASF subversion and git services added a comment - Commit 1522740 from Kim Haase in branch 'docs/trunk' [ https://svn.apache.org/r1522740 ] DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable Added paragraphs to a Reference Manual topic and a Developer's Guide topic. Patch: DERBY-6127 .diff
          Hide
          ASF subversion and git services added a comment -

          Commit 1522740 from Kim Haase in branch 'docs/trunk'
          [ https://svn.apache.org/r1522740 ]

          DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable

          Added paragraphs to a Reference Manual topic and a Developer's Guide topic.

          Patch: DERBY-6127.diff

          Show
          ASF subversion and git services added a comment - Commit 1522740 from Kim Haase in branch 'docs/trunk' [ https://svn.apache.org/r1522740 ] DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable Added paragraphs to a Reference Manual topic and a Developer's Guide topic. Patch: DERBY-6127 .diff
          Hide
          ASF subversion and git services added a comment -

          Commit 1522744 from Kim Haase in branch 'docs/branches/10.10'
          [ https://svn.apache.org/r1522744 ]

          DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable

          Merged patch DERBY-6127.diff to 10.10 doc branch from trunk revision 1522740.

          Show
          ASF subversion and git services added a comment - Commit 1522744 from Kim Haase in branch 'docs/branches/10.10' [ https://svn.apache.org/r1522744 ] DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable Merged patch DERBY-6127 .diff to 10.10 doc branch from trunk revision 1522740.
          Hide
          ASF subversion and git services added a comment -

          Commit 1522744 from Kim Haase in branch 'docs/branches/10.10'
          [ https://svn.apache.org/r1522744 ]

          DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable

          Merged patch DERBY-6127.diff to 10.10 doc branch from trunk revision 1522740.

          Show
          ASF subversion and git services added a comment - Commit 1522744 from Kim Haase in branch 'docs/branches/10.10' [ https://svn.apache.org/r1522744 ] DERBY-6127 Tell users to make sure that the state of a user-defined aggregate needs to be serializable Merged patch DERBY-6127 .diff to 10.10 doc branch from trunk revision 1522740.
          Hide
          Kim Haase added a comment -

          Thanks again, Rick.

          Committed patch DERBY-6127.diff to documentation trunk at revision 1522740.

          Merged to 10.10 doc branch at revision 1522744.

          Show
          Kim Haase added a comment - Thanks again, Rick. Committed patch DERBY-6127 .diff to documentation trunk at revision 1522740. Merged to 10.10 doc branch at revision 1522744.

            People

            • Assignee:
              Kim Haase
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development