another group bug

This forum is to report technical problems with Rel.
Post Reply
tjerkheijboer
Posts: 9
Joined: Thu Jun 10, 2010 12:12 pm

another group bug

Post by tjerkheijboer »

Hi,

Is it possible to do multiple groupings on different attributes of a relation? It seems it should be possible but when I try it with the following;

/ ------------------------------------ type definitions ------------------------------------------
TYPE Pt POSSREP {X RATIONAL, Y RATIONAL};
TYPE L# POSSREP {L# CHAR};

TYPE LINESEG POSSREP { LINESEG RELATION {Pt Pt}};




// ------------------------------------ relvar definitions ---------------------------------------

VAR P BASE RELATION {Pt Pt} KEY {Pt};

VAR L BASE RELATION {L# L#} KEY {L#};
VAR LP BASE RELATION {L# L#, Pt Pt} KEY {L#, Pt};

// ------------------------------------ relvar loading -------------------------------------------

// points

P := RELATION {

TUPLE {Pt Pt(0.0,0.0)},

TUPLE {Pt Pt(0.0,1.0)},

TUPLE {Pt Pt(1.0,0.0)},

TUPLE {Pt Pt(1.0,1.0)}

};



// LP (WHICH POINTS ARE IN WHICH LINESEGMENTS)

//CONSTRAINT LS_CON COUNT(LSPOINTS) = 2;



// line segment id numbers

L := RELATION {

TUPLE {L# L#("L1")},

TUPLE {L# L#("L2")},

TUPLE {L# L#("L3")},

TUPLE {L# L#("L4")}

};



// linesegment has points
LP := RELATION {

TUPLE {L# L#("L1"),Pt Pt(0.0,0.0)},

TUPLE {L# L#("L1"), Pt Pt(0.0,1.0)},

TUPLE {L# L#("L2"), Pt Pt(0.0,1.0)},

TUPLE {L# L#("L2"), Pt Pt(1.0,1.0)},

TUPLE {L# L#("L3"), Pt Pt(1.0,1.0)},

TUPLE {L# L#("L3"), Pt Pt(1.0,0.0)},

TUPLE {L# L#("L4"), Pt Pt(1.0,0.0)},

TUPLE {L# L#("L4"), Pt Pt(0.0,0.0)}

};



CONSTRAINT LP_L_KEY LP {L#} <= L {L#};

CONSTRAINT LP_P_KEY LP {Pt} <= P {Pt};


// using this expression:
((((LP RENAME (L# AS L#1, Pt AS Pt1) JOIN LP) WHERE NOT(L# = L#1)) GROUP ({Pt1} AS PtS )) GROUP ({L#} AS L#s))

I get the following erroneous relation:

((((LP RENAME (L# AS L#1, Pt AS Pt1) JOIN LP) WHERE NOT(L# = L#1)) GROUP ({Pt1} AS PtS )) GROUP ({L#} AS L#s))
RELATION {L#1 L#, Pt Pt, PtS RELATION {Pt1 Pt}, L#s RELATION {L# L#}} {
TUPLE {L#1 L#("L1"), Pt Pt(0.0, 1.0), PtS RELATION {
TUPLE {Pt1 Pt(0.0, 0.0)},
TUPLE {Pt1 Pt(0.0, 1.0)}
}, L#s RELATION {ERROR: ValueRelation: compareTo invoked.
ca.mb.armchair.rel3.exceptions.ExceptionFatal: ValueRelation: compareTo invoked.
at ca.mb.armchair.rel3.values.ValueRelation.compareTo(ValueRelation.java:657)
at ca.mb.armchair.rel3.values.ValueAbstract.equals(ValueAbstract.java:33)
at ca.mb.armchair.rel3.types.JoinMap.isJoinable(JoinMap.java:41)
at ca.mb.armchair.rel3.values.ValueRelation$9$1.hasNextPair(ValueRelation.java:352)
at ca.mb.armchair.rel3.values.ValueRelation$9$1.hasNext(ValueRelation.java:366)
at ca.mb.armchair.rel3.values.ValueRelation$3$1.hasNext(ValueRelation.java:109)
at ca.mb.armchair.rel3.values.TupleIteratorUnique.hasNext(TupleIteratorUnique.java:25)
at ca.mb.armchair.rel3.values.ValueRelation.toStream(ValueRelation.java:623)
at ca.mb.armchair.rel3.values.ValueTuple.toStream(ValueTuple.java:104)
at ca.mb.armchair.rel3.values.ValueRelation.toStream(ValueRelation.java:628)
at ca.mb.armchair.rel3.interpreter.Evaluation.toStream(Evaluation.java:22)
at ca.mb.armchair.rel3.client.stream.ClientLocalConnection$1.execute(ClientLocalConnection.java:69)
at ca.mb.armchair.rel3.client.stream.ClientLocalConnection.send(ClientLocalConnection.java:42)
at ca.mb.armchair.rel3.client.stream.ClientLocalConnection.sendEvaluate(ClientLocalConnection.java:67)
at ca.mb.armchair.rel3.client.string.ClientLocal.sendEvaluate(ClientLocal.java:52)
at ca.mb.armchair.rel3.dbrowser.ui.PanelCommandline$36.doInBackground(PanelCommandline.java:1136)
at javax.swing.SwingWorker$1.call(SwingWorker.java:291)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at javax.swing.SwingWorker.run(SwingWorker.java:330)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)

I am working on ubuntu 10.04 (for the rest it seems to work fine; one group is ok!)

cheers

Tjerk
tjerkheijboer
Posts: 9
Joined: Thu Jun 10, 2010 12:12 pm

Re: another group bug

Post by tjerkheijboer »

possibly its the same problem as here http://shark.armchair.mb.ca/~dave/relfo ... ?f=2&t=107...
Dave
Site Admin
Posts: 368
Joined: Sun Nov 27, 2005 7:19 pm

Re: another group bug

Post by Dave »

tjerkheijboer wrote:possibly its the same problem as here http://shark.armchair.mb.ca/~dave/relfo ... ?f=2&t=107...
It's a bug - which I will fix in the next update - but not the same one. The one you've linked has been fixed for a year and a half. :D
Post Reply