InseeFr/Trevas

Naming of operation outputs (`bool_var`)

Opened this issue · 4 comments

@noahboerger you reported:

In trevas the result of a logical operation is called bool_var instead of having the same name as the input column

Any example inconsistent with the specification?

This behaviour is not inconsistent with the specification. Nevertheless the specification is out of my point of view a bit less strict in these cases (reference manual p. 47 f.):

The following table shows the default Variable names and the relevant default Value Domain. These are only the names used in this manual for explanatory purposes and can be personalised in the implementations. If VTL rules are exchanged, the personalised names need to be shared with the partners of the exchange.

Would it not be better to enforce these defaults, to ensure compatibility between different engines and remove the explicit allowment for personalized default names, which may have lead to the failures of some of our test cases?

Using a variable name derived from the input sound good in theory, but in practice any expression with more than one variable cannot use this mechanism: foo(a + b - c) * d -> ?.

We "could" analyse the expression and see if there's only on variable in the tree, but in the end if a variable passes a couple of functions and operators, is keeping the same name really something that is desired?

AFAIR the spec switches from one convention to another. Some operators have their own names and other rely on the global convention. This should be clarified in the spec & function definitions. And the TCK should tests these cases.

bool_var is used for validation results in Trevas. It's maybe strange, but it matches the specification I think.

@NicoLaval as mentioned in my previous comment, the reference manual seems to only recommend the output name for such cases. You are using these recommendations, which is totally matching the specification. Nevertheless, i think it would be useful, to ensure these names also in the VTL specification, to ensure the compatibility between different engines.