1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/planner/column_binding_map.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/common/types/hash.hpp"
12#include "duckdb/common/unordered_map.hpp"
13#include "duckdb/common/unordered_set.hpp"
14#include "duckdb/planner/column_binding.hpp"
15
16namespace duckdb {
17
18struct ColumnBindingHashFunction {
19 uint64_t operator()(const ColumnBinding &a) const {
20 return CombineHash(left: Hash<idx_t>(val: a.table_index), right: Hash<idx_t>(val: a.column_index));
21 }
22};
23
24struct ColumnBindingEquality {
25 bool operator()(const ColumnBinding &a, const ColumnBinding &b) const {
26 return a == b;
27 }
28};
29
30template <typename T>
31using column_binding_map_t = unordered_map<ColumnBinding, T, ColumnBindingHashFunction, ColumnBindingEquality>;
32
33using column_binding_set_t = unordered_set<ColumnBinding, ColumnBindingHashFunction, ColumnBindingEquality>;
34
35} // namespace duckdb
36