Commit 4ad9be44 authored by R.W.Majeed's avatar R.W.Majeed
Browse files

ignored map rules for null values fixed for eav tables

parent 9a9b66ea
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -226,11 +226,7 @@ public abstract class Column<T> {
			Objects.requireNonNull(index);
			Object rowval = row[index];
			// string processing (na, regex-replace, mapping) only performed on string values
			if( rowval == null ){
				ret = null; // null value
				// XXX FIXME allow map processing for null values
				ret = processedValue((String)null, mapFeedback);
			}else if( rowval instanceof String ){
			if( rowval == null || rowval instanceof String ){
				// non null string value
				ret = processedValue((String)rowval, mapFeedback);
			}else if( na != null || regexReplace != null || map != null ){
@@ -264,9 +260,7 @@ public abstract class Column<T> {
			}else{
				ret = valueFromString(constantValue); // use constant value
			}
		}else if( rowval == null ){
			ret = null;
		}else if( rowval instanceof String ){
		}if( rowval == null || rowval instanceof String ){
			ret = processedValue((String)rowval, mapFeedback);
		}else if( na != null || regexReplace != null || map != null ){
			throw new ParseException("String operation (na/regexReplace/map) defined for column "+getName()+", but table source provides type "+rowval.getClass().getName()+" instead of String");
+5 −0
Original line number Diff line number Diff line
@@ -77,6 +77,11 @@ public class TestReadTables {
			Assert.assertNotNull(r);
			Assert.assertTrue(r.getFacts().size() > 0);
			Observation o = r.getFacts().get(0);
			// next fact without value. Verify mapped concept
			Assert.assertEquals("f_eav_m_m", o.getConceptId());
			
			// next fact with numeric value
			o = s.get().getFact();
			Assert.assertEquals("f_eav_b", o.getConceptId());
			Assert.assertEquals(Value.Type.Numeric, o.getValue().getType());
			Assert.assertEquals(BigDecimal.valueOf(3.9), o.getValue().getNumericValue());
+3 −0
Original line number Diff line number Diff line
@@ -111,6 +111,9 @@
		<!-- virtual value columns -->
		<virtual>
			<!-- for eav facts, the map always applies to the fact value -->
			<value column="f_eav_m" xsi:type="string">
				<map set-concept="f_eav_m_m" />
			</value>
			<value column="f_eav_x" na="" xsi:type="string">
				<map set-value="">
					<case value="1" set-concept="f_eav_x_1"/>
+1 −0
Original line number Diff line number Diff line
patid	event	locat	user	param	start_ts	end	type	value	unit
p1	v1	L1	u1	f_eav_m	2013-08-19	@	@	@	@
p1	v1	L1	u1	f_eav_b	2013-08-19	@	decimal	3.9	@
p1	v1	L1	u1	f_eav_c	2013-08-19	@	decimal	11.2	@
p1	v1	L1	u1	f_eav_d	2013-08-19	@	decimal	66.0	@