def trino_to_pa_value_type(trino_type_as_str: str) -> pa.DataType:
    trino_type_as_str = trino_type_as_str.lower()
    _is_list: bool = False
    if trino_type_as_str.startswith('array'):
        _is_list = True
        trino_type_as_str = re.search('^array\\((\\w+)\\)$', trino_type_as_str).group(1)
    if trino_type_as_str.startswith('decimal'):
        search_precision = re.search('^decimal\\((\\d+)(?>,\\s?\\d+)?\\)$', trino_type_as_str)
        if search_precision:
            precision = int(search_precision.group(1))
            if (precision > 32):
                pa_type = pa.float64()
            else:
                pa_type = pa.float32()
    elif trino_type_as_str.startswith('timestamp'):
        pa_type = pa.timestamp('us')
    elif trino_type_as_str.startswith('varchar'):
        pa_type = pa.string()
    else:
        pa_type = _TRINO_TO_PA_TYPE_MAP[trino_type_as_str]
    if _is_list:
        return pa.list_(pa_type)
    else:
        return pa_type
def trino_to_pa_value_type(trino_type_as_str: str) -> pa.DataType:
    trino_type_as_str = trino_type_as_str.lower()
    _is_list: bool = False
    if trino_type_as_str.startswith('array'):
        _is_list = True
        trino_type_as_str = re.search('^array\\((\\w+)\\)$', trino_type_as_str).group(1)
    if trino_type_as_str.startswith('decimal'):
        search_precision = re.search('^decimal\\((\\d+)(?>,\\s?\\d+)?\\)$', trino_type_as_str)
        if search_precision:
            precision = int(search_precision.group(1))
            if (precision > 32):
                pa_type = pa.float64()
            else:
                pa_type = pa.float32()
    elif trino_type_as_str.startswith('timestamp'):
        pa_type = pa.timestamp('us')
    elif trino_type_as_str.startswith('varchar'):
        pa_type = pa.string()
    else:
        pa_type = _TRINO_TO_PA_TYPE_MAP[trino_type_as_str]
    if _is_list:
        return pa.list_(pa_type)
    else:
        return pa_type