import re


def replace_with_null_body(udf_path):
    """
    For a given path to a UDF DDL file, parse the SQL and return
    the UDF with the body entirely replaced with NULL.

    :param udf_path: Path to the UDF DDL .sql file
    :return: Input UDF DDL with a NULL body
    """
    with open(udf_path) as udf_file:
        udf_sql = udf_file.read()
    udf_sql = udf_sql.replace('\n', ' ')
    pattern = re.compile(r'FUNCTION\s+(`?.+?`?.*?\).*?\s+)AS')
    match = pattern.search(udf_sql)
    if match:
        udf_signature = match[1].replace('LANGUAGE js', '')
        udf_null_body = (f'CREATE FUNCTION IF NOT EXISTS {udf_signature}'
                         f' AS (NULL)')
        return udf_null_body
    else:
        return None