PDA

View Full Version : [Mondrian] Util.createSimpleValidator()



Anton Nikitin
05-29-2007, 09:50 AM
Hello!

Are there any objective reasons why mondrian.olap.Util.
createSimpleValidator() method returns validator which doesn't implement
canConvert() properly (the same way as StackValidator does - by using
FunUtil.canConvert()).

Anton

_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian

Julian Hyde
05-29-2007, 03:11 PM
That validator is basically a mock object - because a validator is
needed in order to convert a UnresolvedFunCall to a ResolvedFunCall.
It's only used in one place.

If you add a call to canConvert, I have a feeling that the validator
will need to know the types of the arguments - which means you'll need
to implement other methods in the validator.

Julian

> -----Original Message-----
> From: mondrian-bounces (AT) pentaho (DOT) org
> [mailto:mondrian-bounces (AT) pentaho (DOT) org] On Behalf Of Anton Nikitin
> Sent: Tuesday, May 29, 2007 6:45 AM
> To: 'Mondrian developer mailing list'
> Subject: [Mondrian] Util.createSimpleValidator()
>
> Hello!
>
> Are there any objective reasons why mondrian.olap.Util.
> createSimpleValidator() method returns validator which
> doesn't implement
> canConvert() properly (the same way as StackValidator does - by using
> FunUtil.canConvert()).
>
> Anton
>
> _______________________________________________
> Mondrian mailing list
> Mondrian (AT) pentaho (DOT) org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>

_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian

Anton Nikitin
05-30-2007, 06:40 AM
Julian,

actually, we have a bit obsolete version of Mondrian used in our
development. In our version Validator interface has convert() method which
calls FunUtil.convert(). I was wondering why convert() has real
implementation while canConvert() is a stub... In newest Mondrian there is
no Validator.convert()...

Original reason was the need of creating an expression containing IIF with
comparison operators at schema load time. Original implementation of simple
validator didn't allow doing it (because of ambiguity between overloaded
operations). When I had added canConvert() delegation to FunUtil it started
to work for us. I haven't touched any other methods.

Maybe I have missed some other ways to implement hardcoded MDX expressions
at startup, haven't I?

Anton



-----Original Message-----
From: mondrian-bounces (AT) pentaho (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) org] On
Behalf Of Julian Hyde
Sent: Tuesday, May 29, 2007 11:05 PM
To: 'Mondrian developer mailing list'
Subject: RE: [Mondrian] Util.createSimpleValidator()

That validator is basically a mock object - because a validator is
needed in order to convert a UnresolvedFunCall to a ResolvedFunCall.
It's only used in one place.

If you add a call to canConvert, I have a feeling that the validator
will need to know the types of the arguments - which means you'll need
to implement other methods in the validator.

Julian

> -----Original Message-----
> From: mondrian-bounces (AT) pentaho (DOT) org
> [mailto:mondrian-bounces (AT) pentaho (DOT) org] On Behalf Of Anton Nikitin
> Sent: Tuesday, May 29, 2007 6:45 AM
> To: 'Mondrian developer mailing list'
> Subject: [Mondrian] Util.createSimpleValidator()
>
> Hello!
>
> Are there any objective reasons why mondrian.olap.Util.
> createSimpleValidator() method returns validator which
> doesn't implement
> canConvert() properly (the same way as StackValidator does - by using
> FunUtil.canConvert()).
>
> Anton
>
> _______________________________________________
> Mondrian mailing list
> Mondrian (AT) pentaho (DOT) org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>

_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian

_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian