statisticsnorway / java-vtl

An Open Source Java implementation of the Validation Transformation Language, based on the VTL 1.1 draft specification. The implementation follows the JSR-223 Java Scripting API and exposes a simple connector interface one can implement in order to integrate with any data stores. VTL is a standard language for defining validation and transformation rules (set of operators, their syntax and semantics) for any kind of statistical data.
http://java-vtl.org
Apache License 2.0
21 stars 7 forks source link

Variable expression in sum throws npe #49

Closed hadrienk closed 7 years ago

hadrienk commented 7 years ago

When using membership in the along/group by list of component to aggregate a NPE was thrown.

sum(ds) along id
sum(ds) along ds.id       // NPE

sum(ds) group by id
sum(ds) group by ds.id // NPE

Since the contextual exception handling is on develop I took the time to include thorough error messages in the visitor.

pawbu commented 7 years ago

Looks good

codecov-io commented 7 years ago

Codecov Report

Merging #49 into develop will increase coverage by 0.19%. The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop     #49      +/-   ##
==========================================
+ Coverage     77.6%   77.8%   +0.19%     
==========================================
  Files          121     121              
  Lines         3246    3266      +20     
  Branches       379     380       +1     
==========================================
+ Hits          2519    2541      +22     
+ Misses         609     608       -1     
+ Partials       118     117       -1
Impacted Files Coverage Δ
...sb/vtl/script/operations/AggregationOperation.java 95% <ø> (ø) :arrow_up:
...b/vtl/script/visitors/AbstractVariableVisitor.java 80% <100%> (+13.33%) :arrow_up:
...no/ssb/vtl/script/visitors/AggregationVisitor.java 96.42% <95.74%> (+2.14%) :arrow_up:
...odel/src/main/java/no/ssb/vtl/model/VTLObject.java 79.59% <0%> (-2.05%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ae7d296...b0263e5. Read the comment docs.