> On May 7, 2015, 4:57 a.m., Amareshwari Sriramadasu wrote: > > lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommandsWithMissingWeight.java, > > line 110 > > <https://reviews.apache.org/r/33838/diff/2/?file=951313#file951313line110> > > > > Didnt this through an exception because of missing weight? > > Yash Sharma wrote: > No. > Infact the generated class for XFactTable used weight as primitive and > hence it gets the default of 0d. > > ```java > @XmlAttribute(name = "weight", required = true) > protected double weight; > ```
Then, I see making it "required" actually didnt solve the purpose. Because missing value actually made it zero. Inthat case I would say we might go with adding default as zero in xsd to be clear, and allow only positive values for weight. Himanshu, thoughts? - Amareshwari ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33838/#review82792 ----------------------------------------------------------- On May 6, 2015, 5:18 p.m., Yash Sharma wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/33838/ > ----------------------------------------------------------- > > (Updated May 6, 2015, 5:18 p.m.) > > > Review request for lens. > > > Repository: lens > > > Description > ------- > > NPE when weight is not set in XFactTable object while creating fact table > > > Diffs > ----- > > lens-api/src/main/resources/cube-0.1.xsd 24d0d64 > > lens-cli/src/test/java/org/apache/lens/cli/TestLensFactCommandsWithMissingWeight.java > PRE-CREATION > lens-cli/src/test/resources/fact_without_weight.xml PRE-CREATION > > Diff: https://reviews.apache.org/r/33838/diff/ > > > Testing > ------- > > Yes. > TestCase: > mvn test -Dtest=TestLensFactCommandsWithMissingWeight#testFactCommands > > > Thanks, > > Yash Sharma > >
