84929 {
84930 const LogicalType candidates[] = {LogicalType::DATE, LogicalType::TIMESTAMP, LogicalType::BIGINT};
84931
84932 unordered_map<string, LogicalType> detected_types;
84933 for (const auto &file : files.Files()) {
84935 if (partitions.empty()) {
84936 return;
84937 }
84938
84939 for (auto &part : partitions) {
84940 const string &name = part.first;
84941 if (hive_types_schema.find(name) != hive_types_schema.end()) {
84942
84943 continue;
84944 }
84946 continue;
84947 }
84948 LogicalType detected_type = LogicalType::VARCHAR;
84949 Value value(part.second);
84950 for (auto &candidate : candidates) {
84951 const bool success = value.TryCastAs(context, candidate, true);
84952 if (success) {
84953 detected_type = candidate;
84954 break;
84955 }
84956 }
84957 auto entry = detected_types.find(name);
84958 if (entry == detected_types.end()) {
84959
84960 detected_types.insert(make_pair(name, std::move(detected_type)));
84961 } else {
84962
84963
84964 if (entry->second != detected_type) {
84965 entry->second = LogicalType::VARCHAR;
84966 }
84967 }
84968 }
84969 }
84970 for (auto &entry : detected_types) {
84971 hive_types_schema.insert(make_pair(entry.first, std::move(entry.second)));
84972 }
84973}
static DUCKDB_API bool IsNull(const string &input)
Whether the column is "NULL"/"__HIVE_DEFAULT_PARTITION".
Definition duckdb.cpp:77853