def create_cast_date_column_query(dbms: str, date_format: str, date_column: str) -> str:
    """
    Create query that cast date column into yyyy-MM-dd format

    :param dbms: data warehouse name
    :param date_format: format of date column
    :param date_column: name of the column with periods
    :return: query to cast date column
    """

    # Convert date format to yyyy-MM-dd
    if dbms == 'hive':
        if date_format in ['yyyy-MM-dd', 'YYYY-MM-DD']:
            casted_date_column = date_column
        else:
            casted_date_column = f"from_unixtime(unix_timestamp({date_column}, '{date_format}'), 'yyyy-MM-dd')"
    elif dbms == 'teradata':
        if date_format in ['yyyy-MM-dd', 'YYYY-MM-DD']:
            casted_date_column = date_column
        else:
            casted_date_column = f"cast(cast({date_column} as varchar(20)) as date format '{date_format}')"
    else:
        raise NotImplementedError('Data warehouses supporting by now : hive and teradata')

    return casted_date_column