@@ -61,14 +61,14 @@ std::vector<String> splitTypeArguments(const String & type_str)
6161 return args;
6262}
6363
64- DB::DataTypePtr getType (const String & type_name, bool nullable, const String & prefix)
64+ DB::DataTypePtr getType (const String & type_name, bool nullable, DB::ContextPtr context, const String & prefix)
6565{
6666 String name = trim (type_name);
6767
6868 if (name.starts_with (" array<" ) && name.ends_with (" >" ))
6969 {
7070 String inner = name.substr (6 , name.size () - 7 );
71- return std::make_shared<DB::DataTypeArray>(getType (inner, nullable));
71+ return std::make_shared<DB::DataTypeArray>(getType (inner, nullable, context ));
7272 }
7373
7474 if (name.starts_with (" map<" ) && name.ends_with (" >" ))
@@ -79,7 +79,7 @@ DB::DataTypePtr getType(const String & type_name, bool nullable, const String &
7979 if (args.size () != 2 )
8080 throw DB::Exception (DB::ErrorCodes::DATALAKE_DATABASE_ERROR, " Invalid data type {}" , type_name);
8181
82- return std::make_shared<DB::DataTypeMap>(getType (args[0 ], false ), getType (args[1 ], nullable));
82+ return std::make_shared<DB::DataTypeMap>(getType (args[0 ], false , context ), getType (args[1 ], nullable, context ));
8383 }
8484
8585 if (name.starts_with (" struct<" ) && name.ends_with (" >" ))
@@ -101,13 +101,13 @@ DB::DataTypePtr getType(const String & type_name, bool nullable, const String &
101101 String full_field_name = prefix.empty () ? field_name : prefix + " ." + field_name;
102102
103103 field_names.push_back (full_field_name);
104- field_types.push_back (getType (field_type, nullable, full_field_name));
104+ field_types.push_back (getType (field_type, nullable, context, full_field_name));
105105 }
106106 return std::make_shared<DB::DataTypeTuple>(field_types, field_names);
107107 }
108108
109- return nullable ? DB::makeNullable (DB::Iceberg::IcebergSchemaProcessor::getSimpleType (name))
110- : DB::Iceberg::IcebergSchemaProcessor::getSimpleType (name);
109+ return nullable ? DB::makeNullable (DB::Iceberg::IcebergSchemaProcessor::getSimpleType (name, context ))
110+ : DB::Iceberg::IcebergSchemaProcessor::getSimpleType (name, context );
111111}
112112
113113std::pair<std::string, std::string> parseTableName (const std::string & name)
0 commit comments