db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5926) Document user-defined aggregates (DERBY-672)
Date Thu, 25 Oct 2012 17:11:12 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484283#comment-13484283
] 

Rick Hillegas commented on DERBY-5926:
--------------------------------------

Thanks for the next rev of the patch, Kim. I like the way that you added links inside Table
1.

I think that a little more tweaking will be necessary. Now Table 1 over-describes the capabilities
of MAX and MIN. Those aggregates only work on indexable datatypes, that is, the ones marked
with a Y in Table 2 of topic "Data type assignments and comparison, sorting, and ordering".
So (to be pedantic), MAX and MIN work on

bigint
boolean
char
char for bit data
date
decimal
double
float
int
numeric
real
smallint
time
timestamp
varchar
varchar for bit data

...and MAX and MIN don't work on

blob
clob
long varchar
long varchar for bit data
user-defined types
xml



The following script shows this:

connect 'jdbc:derby:memory:db;create=true';

create type serializableType external name 'java.io.Serializable' language java;

create table allTypes
(
    bigintCol bigint,
    blobCol blob,
    booleanCol boolean,
    charCol char( 5 ),
    charForBitDataCol char( 5 ) for bit data,
    clobCol clob,
    dateCol date,
    decimalCol decimal,
    doubleCol double,
    floatCol float,
    intCol int,
    longVarcharCol long varchar,
    longVarcharForBitDataCol long varchar for bit data,
    numericCol numeric,
    realCol real,
    smallintCol smallint,
    timeCol time,
    timestampCol timestamp,
    userDefinedTypeCol serializableType,
    varcharCol varchar( 5 ),
    varcharForBitDataCol varchar( 5 ) for bit data,
    xmlCol xml
);

select max( bigintCol ) from allTypes;
select max( blobCol ) from allTypes;
select max( booleanCol ) from allTypes;
select max( charCol ) from allTypes;
select max( charForBitDataCol ) from allTypes;
select max( clobCol ) from allTypes;
select max( dateCol ) from allTypes;
select max( decimalCol ) from allTypes;
select max( doubleCol ) from allTypes;
select max( floatCol ) from allTypes;
select max( intCol ) from allTypes;
select max( longVarcharCol ) from allTypes;
select max( longVarcharForBitDataCol ) from allTypes;
select max( numericCol ) from allTypes;
select max( realCol ) from allTypes;
select max( smallintCol ) from allTypes;
select max( timeCol ) from allTypes;
select max( timestampCol ) from allTypes;
select max( userDefinedTypeCol ) from allTypes;
select max( varcharCol ) from allTypes;
select max( varcharForBitDataCol ) from allTypes;
select max( xmlCol ) from allTypes;

Thanks,
-Rick
                
> Document user-defined aggregates (DERBY-672)
> --------------------------------------------
>
>                 Key: DERBY-5926
>                 URL: https://issues.apache.org/jira/browse/DERBY-5926
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Documentation
>    Affects Versions: 10.10.0.0
>            Reporter: Kim Haase
>            Assignee: Kim Haase
>         Attachments: DERBY-5926-2.diff, DERBY-5926-2.zip, DERBY-5926.diff, DERBY-5926.stat,
DERBY-5926.zip
>
>
> Documentation is needed for the new user-defined aggregates feature, both in the Reference
Manual and the Developer's Guide, as described in the functional specification.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message