def normalize_item(item, field_def)
      return case field_def[:type]
        when 'long', 'int' then Integer(item)
        when 'double', 'float' then Float(item)
        when 'boolean' then item.kind_of?(String) ?
            item.casecmp('true') == 0 : item
        else item
      end
    end
def normalize_item(item, field_def)
      return case field_def[:type]
        when 'long', 'int' then Integer(item)
        when 'double', 'float' then Float(item)
        when 'boolean' then item.kind_of?(String) ?
            item.casecmp('true') == 0 : item
        else item
      end
    end
Converts one leaf item to a built-in type.