Comment : Charset=windows-1252
Comment : regular simple test cases for aggregate
Request : inquire aggregate(semijoin(attributelogicallength,project(join(systemdefinedrelvar,recordtype,recordattribute),(attributename))),maxsize(max(logicallength)))
Reply   : RELATION(HEADING(MAXSIZE(INT))BODY(TUPLE(MAXSIZE(124))))
Request : inquire aggregate(semijoin(attributelogicallength,project(join(systemdefinedrelvar,recordtype,recordattribute),(attributename))),maxsize(max(logicallength))minsize(min(logicallength))sum(plus(logicallength)))
Reply   : RELATION(HEADING(MINSIZE(INT)SUM(INT)MAXSIZE(INT))BODY(TUPLE(MINSIZE(60)SUM(1088)MAXSIZE(124))))
Request : inquire aggregate(extend(table_dum,a(int(1))),maxa(max(a)))
Reply   : RELATION(HEADING(MAXA(INT))BODY(TUPLE(MAXA(-2147483648))))
Request : inquire aggregate(extend(table_dum,a(int(1))),maxa(max(a))mina(min(a))sum(plus(a)))
Reply   : RELATION(HEADING(MINA(INT)MAXA(INT)SUM(INT))BODY(TUPLE(MINA(2147483647)MAXA(-2147483648)SUM(0))))
Request : inquire aggregate(extend(table_dee,a(int(1))),maxa(max(a)))
Reply   : RELATION(HEADING(MAXA(INT))BODY(TUPLE(MAXA(1))))
Request : inquire aggregate(extend(table_dee,a(int(1))),maxa(max(a))mina(min(a))sum(plus(a)))
Reply   : RELATION(HEADING(SUM(INT)MAXA(INT)MINA(INT))BODY(TUPLE(SUM(1)MAXA(1)MINA(1))))
Request : inquire aggregate(table_dum,maxa(max(int(1))))
Reply   : RELATION(HEADING(MAXA(INT))BODY(TUPLE(MAXA(-2147483648))))
Request : inquire aggregate(table_dum,maxa(max(int(1)))mina(min(int(1)))sum(plus(int(1))))
Reply   : RELATION(HEADING(MINA(INT)SUM(INT)MAXA(INT))BODY(TUPLE(MINA(2147483647)SUM(0)MAXA(-2147483648))))
Request : inquire aggregate(table_dee,maxa(max(int(1))))
Reply   : RELATION(HEADING(MAXA(INT))BODY(TUPLE(MAXA(1))))
Request : inquire aggregate(table_dee,maxa(max(int(1)))mina(min(int(1)))sum(plus(int(1))))
Reply   : RELATION(HEADING(MINA(INT)SUM(INT)MAXA(INT))BODY(TUPLE(MINA(1)SUM(1)MAXA(1))))
Request : inquire aggregate(project(join(recordtype,systemdefinedrelvar),(relvarname)),count(plus(int(1))))
Reply   : RELATION(HEADING(COUNT(INT))BODY(TUPLE(COUNT(59))))
Request : inquire aggregate(relvarid,count(plus(relvardi)))
Reply   : 1497858657:325:Name 'relvardi' did not resolve as an attribute reference in its lexical scope { RELVARID:LONG RELVARNAME:NAME }, nor is it equal to an existing relvar name. The cause of this problem was a be.SIRAPRISE.server.NotARelvarException with message Requested Relation variable RELVARDI could not be found in the catalog..
Request : inquire aggregate(relvarid,count(plus(#|@&{}[])))
Reply   : 858993459:-1:java.lang.IllegalArgumentException:# is not a valid token in values of type NAME.
Request : inquire aggregate(relvarid,concatenated(concat(the_string(relvarname))))
Reply   : 1497858657:302:Operator CONCAT on type STRING is not associative and cannot be used in AGGREGATE.
Request : inquire aggregate(relvarid,(plus(int(1))))
Reply   : 858993459:-1:java.lang.IllegalArgumentException: is not a valid token in values of type NAME.
Request : inquire aggregate(relvarid,count(plus(int(1)))blahblah)
Reply   : 858993459:-1:java.lang.IllegalArgumentException:Size 0 of value '' is outside of size range (1-60) for this type.
Request : inquire aggregate(relvarid,count(plus(int(1)))(plus(int(1))))
Reply   : 858993459:-1:java.lang.IllegalArgumentException:Size 0 of value '' is outside of size range (1-60) for this type.
Request : inquire aggregate(relvarid,count(plus(int(1)))count(plus(int(1))))
Reply   : 1497858657:186:Duplicate attribute name COUNT in output relation type of relvarid

Comment : regular test cases for aggregate over RVA's
Request : inquire aggregate(group(keyattribute,attributes(attributename)),intersect(intersect(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY()))))
Request : inquire aggregate(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),intersect(intersect(attributes))union(union(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME))))UNION(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY())UNION(BODY(TUPLE(ATTRIBUTENAME(ORDINAL))TUPLE(ATTRIBUTENAME(ERRORCODE))TUPLE(ATTRIBUTENAME(ATTRIBUTENAME))TUPLE(ATTRIBUTENAME(STORAGESPACEID))TUPLE(ATTRIBUTENAME(INDEXID))TUPLE(ATTRIBUTENAME(USERID))TUPLE(ATTRIBUTENAME(OPERATIONTYPE))TUPLE(ATTRIBUTENAME(COMPONENTNAME))TUPLE(ATTRIBUTENAME(CLIENTID))TUPLE(ATTRIBUTENAME(TRIGGEREDOPERATIONTYPE))TUPLE(ATTRIBUTENAME(INDEXNAME))TUPLE(ATTRIBUTENAME(POSSREPNAME))TUPLE(ATTRIBUTENAME(BYPASSASSGCONSTRAINTS))TUPLE(ATTRIBUTENAME(INTERVALTYPENAME))TUPLE(ATTRIBUTENAME(RECORDTYPEID))TUPLE(ATTRIBUTENAME(ISDISTINCT))TUPLE(ATTRIBUTENAME(ALGORITHM))TUPLE(ATTRIBUTENAME(FILENAME))TUPLE(ATTRIBUTENAME(RECORDTYPENAME))TUPLE(ATTRIBUTENAME(RELVARNAME))TUPLE(ATTRIBUTENAME(RELVARID))TUPLE(ATTRIBUTENAME(TYPENAME))TUPLE(ATTRIBUTENAME(DATAACTIONNAME))TUPLE(ATTRIBUTENAME(TARGETRELVARNAME)))))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),eq(relvarname,name(relvarattribute))),intersect(intersect(attributes)))
Reply   : 1497858657:310:The universal relation for relation type/heading { ATTRIBUTENAME:NAME } cannot be generated.
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),eq(relvarname,name(relvarattribute))),intersect(intersect(attributes))union(union(attributes)))
Reply   : 1497858657:310:The universal relation for relation type/heading { ATTRIBUTENAME:NAME } cannot be generated.
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),eq(relvarname,name(intervaltype))),intersect(intersect(attributes))union(union(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME))))UNION(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY())UNION(BODY(TUPLE(ATTRIBUTENAME(TYPENAME))TUPLE(ATTRIBUTENAME(INTERVALTYPENAME)))))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),eq(relvarname,name(key))),intersect(intersect(attributes))union(union(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME))))UNION(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY(TUPLE(ATTRIBUTENAME(ERRORCODE))))UNION(BODY(TUPLE(ATTRIBUTENAME(ERRORCODE)))))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),or(eq(relvarname,name(relvarattribute)),eq(relvarname,name(relvar)))),intersect(intersect(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY(TUPLE(ATTRIBUTENAME(RELVARNAME)))))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),or(eq(relvarname,name(relvarattribute)),eq(relvarname,name(relvar)))),intersect(intersect(attributes))union(union(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME))))UNION(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY(TUPLE(ATTRIBUTENAME(RELVARNAME))))UNION(BODY(TUPLE(ATTRIBUTENAME(RELVARNAME)))))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),or(eq(relvarname,name(storagespace)),eq(relvarname,name(relvar)))),intersect(intersect(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY()))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),or(eq(relvarname,name(storagespace)),eq(relvarname,name(relvar)))),intersect(intersect(attributes))union(union(attributes)))
Reply   : RELATION(HEADING(INTERSECT(RELATION(HEADING(ATTRIBUTENAME(NAME))))UNION(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(INTERSECT(BODY())UNION(BODY(TUPLE(ATTRIBUTENAME(STORAGESPACEID))TUPLE(ATTRIBUTENAME(FILENAME))TUPLE(ATTRIBUTENAME(RELVARNAME)))))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),eq(relvarname,name(nonexistant))),uniona(union(attributes)))
Reply   : RELATION(HEADING(UNIONA(RELATION(HEADING(ATTRIBUTENAME(NAME)))))BODY(TUPLE(UNIONA(BODY()))))
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),eq(relvarname,name(nonexistant))),intrsa(intersect(attributes)))
Reply   : 1497858657:310:The universal relation for relation type/heading { ATTRIBUTENAME:NAME } cannot be generated.
Request : inquire aggregate(restrict(group(semijoin(join(key,keyattribute),project(join(recordtype,systemdefinedrelvar),(relvarname))),attributes(attributename)),eq(relvarname,name(nonexistant))),joinna(join(attributes)))
Reply   : 1497858657:315:JOIN does not have an identity element for any specific relation type.

Comment : some test cases for aggregation over expressions using the several distinct access paths

Comment : this one computes the average name length of all catalog attribute names
Comment : it needs only the attribute name, which can be satisfied using an index-only strategy
Request : inquire aggregate(semijoin(attribute,join(recordtype,recordattribute,systemdefinedrelvar)),averagenamelength(plus(average(count(int(1))value(float(the_string(length(attributename))))))))
Reply   : RELATION(HEADING(AVERAGENAMELENGTH(AVERAGE))BODY(TUPLE(AVERAGENAMELENGTH(COUNT(43)VALUE(11.790697674418603)))))

Comment : this one computes the average name length of all variable-length catalog attributes
Comment : it needs only the attribute name, which can be satisfied using an index-only strategy, but runs on another relvar
Request : inquire aggregate(semijoin(attributelogicallength,join(recordtype,recordattribute,systemdefinedrelvar)),averagenamelength(plus(average(count(int(1))value(float(the_string(length(attributename))))))))
Reply   : RELATION(HEADING(AVERAGENAMELENGTH(AVERAGE))BODY(TUPLE(AVERAGENAMELENGTH(COUNT(17)VALUE(11.764705882352944)))))

Comment : this one computes both the average length and the average name length of all variable-length catalog attributes
Comment : it needs both the attribute name and the logical length, which requires a datarecord sweeping strategy
Request : inquire aggregate(semijoin(attributelogicallength,join(recordtype,recordattribute,systemdefinedrelvar)),averagelength(plus(average(count(int(1))value(float(the_string(logicallength))))))averagenamelength(plus(average(count(int(1))value(float(the_string(length(attributename))))))))
Reply   : RELATION(HEADING(AVERAGELENGTH(AVERAGE)AVERAGENAMELENGTH(AVERAGE))BODY(TUPLE(AVERAGELENGTH(COUNT(17)VALUE(64.00000000000003))AVERAGENAMELENGTH(COUNT(17)VALUE(11.764705882352942)))))
END
