public void TypeMismatch(Field field, IDataReader reader, int index) { var key = HashcodeTransform.GetHashCode(field.Name, field.Type); if (_errors.Add(key)) { _context.Error("Type mismatch for {0}. Expected {1}, but read {2}.", field.Name, field.Type, reader.GetFieldType(index)); } }
private void AddInnerRow(ref IRow innerRow, ref IRow outerRow, ref List <IRow> innerRows) { var r = _rowFactory.Clone(innerRow, _fields); foreach (var field in _outerFields) { r[field] = outerRow[field]; } if (!Context.Process.ReadOnly) { r = _setSystemFields.Operate(r); r[_hashCode] = HashcodeTransform.GetHashCode(_fieldsToHash.Select(f => r[f])); } innerRows.Add(r); innerRow = _rowFactory.Create(); foreach (var field in _fields) { innerRow[field] = field.Default == Constants.DefaultSetting ? _typeDefaults[field.Type] : field.Convert(field.Default); } }
public Row Transform(Row row) { row.TflHashCode = HashcodeTransform.GetHashCode(_fieldsToHash.Select(f => row[f])); row[_tflHashCode] = row.TflHashCode; return(row); }