GetDataValue returns the DataValue for the specified index. It first check validity of the value, then it check whether it's a boolean column to decide whether to load bool value or other value type. Index bound is not checked!
(offset int)
| 170 | // boolean column to decide whether to load bool value or other value |
| 171 | // type. Index bound is not checked! |
| 172 | func (vp *cVectorParty) GetDataValue(offset int) common.DataValue { |
| 173 | if vp.columnMode == common.AllValuesDefault { |
| 174 | return vp.defaultValue |
| 175 | } |
| 176 | |
| 177 | val := common.DataValue{ |
| 178 | Valid: vp.GetValidity(offset), |
| 179 | DataType: vp.dataType, |
| 180 | } |
| 181 | if !val.Valid { |
| 182 | return val |
| 183 | } |
| 184 | |
| 185 | if vp.values.DataType == common.Bool { |
| 186 | val.IsBool = true |
| 187 | val.BoolVal = vp.values.GetBool(offset) |
| 188 | return val |
| 189 | } |
| 190 | val.OtherVal = vp.values.GetValue(offset) |
| 191 | val.CmpFunc = vp.values.CmpFunc |
| 192 | return val |
| 193 | } |
| 194 | |
| 195 | // GetDataValueByRow implements GetDataValueByRow in cVectorParty |
| 196 | func (vp *cVectorParty) GetDataValueByRow(row int) common.DataValue { |
no test coverage detected