message: Now uses templated comparison, removing the TemplatedListContainsStringFunction
diff: @@ -12,66 +12,13 @@ static void SetResultFalse(Vector &result) {
  }
  template <class T>
  -static void TemplatedListContainsStringFunction(DataChunk &args, ExpressionState &state, Vector &result) {
  - D_ASSERT(args.ColumnCount() == 2);
  - auto count = args.size();
  - Vector &list = args.data[0];
  - Vector &value = args.data[1];
  - VectorData value_data;
  - value.Orrify(count, value_data);
  -
  - if (list.GetType().id() == LogicalTypeId::SQLNULL) {
  - SetResultFalse(result);
  - return;
  - }
  -
  - auto list_size = ListVector::GetListSize(list);
  - if (list_size == 0) { // empty list will never contain a value
  - SetResultFalse(result);
  - return;
  - }
  - auto &child_vector = ListVector::GetEntry(list);
  - if (child_vector.GetType().id() == LogicalTypeId::SQLNULL) {
  - SetResultFalse(result);
  - return;
  - }
  - VectorData child_data;
  - child_vector.Orrify(list_size, child_data);
  -
  - VectorData list_data;
  - list.Orrify(count, list_data);
  - auto list_entries = (list_entry_t *)list_data.data;
  -
  - result.SetVectorType(VectorType::FLAT_VECTOR);
  - auto result_entries = FlatVector::GetData<bool>(result); // Create a vector of bool
  - auto &result_validity = FlatVector::Validity(result);
  -
  - for (idx_t i = 0; i < count; i++) {
  - auto list_index = list_data.sel->get_index(i);
  -
  - if (!list_data.validity.RowIsValid(list_index)) {
  - result_validity.SetInvalid(i);
  - continue;
  +static inline bool ValueCompare(const T &left, const T &right) {
  + return left == right;
  }
  - result_entries[list_index] = false;
  -
  - const auto &entry = list_entries[list_index];
  - auto source_idx = child_data.sel->get_index(entry.offset);
  - auto child_value = FlatVector::GetData<T>(child_vector);
  - for (idx_t child_idx = 0; child_idx < entry.length; child_idx++) {
  - auto value_idx = source_idx + child_idx;
  - if (!child_data.validity.RowIsValid(value_idx)) {
  - continue;
  - }
  - auto actual_value = child_value[value_idx];
  - if (StringComparisonOperators::EqualsOrNot<false>(actual_value, ((T *)value_data.data)[0])) {
  - result_entries[list_index] = true;
  - break; // Found value in list, no need to look further
  - }
  - }
  - }
  - return;
  +template <>
  +inline bool ValueCompare(const string_t &left, const string_t &right) {
  + return StringComparisonOperators::EqualsOrNot<false>(left, right);
  }
  template <class T>
  @@ -128,7 +75,7 @@ static void TemplatedListContainsFunction(DataChunk &args, ExpressionState &stat
  continue;
  }
  auto actual_value = child_value[value_idx];
  - if (actual_value == ((T *)value_data.data)[0]) {
  + if (ValueCompare(actual_value, ((T *)value_data.data)[0])) {
  result_entries[list_index] = true;
  break; // Found value in list, no need to look further
  }
  @@ -174,7 +121,7 @@ static void ListContainsFunction(DataChunk &args, ExpressionState &state, Vector
  TemplatedListContainsFunction<double>(args, state, result);
  break;
  case PhysicalType::VARCHAR:
  - TemplatedListContainsStringFunction<string_t>(args, state, result);
  + TemplatedListContainsFunction<string_t>(args, state, result);
  break;
  case PhysicalType::LIST:
  throw NotImplementedException("This function has not yet been implemented for nested types");
  