def _render_condition_value(value, field_type):
    """Render a query condition value.

    Parameters
    ----------
    value : Union[bool, int, float, str, datetime]
        The value of the condition
    field_type : str
        The data type of the field

    Returns
    -------
    str
        A value string.
    """
    if field_type == 'BOOLEAN':
        value = 1 if value else 0
    elif field_type in ('STRING', 'INTEGER', 'FLOAT'):
        value = "'%s'" % value
    elif field_type in 'TIMESTAMP':
        value = "'%s'" % str(value)
    return '%s(%s)' % (field_type, value)
