[fix](jdbc catalog) fix jdbc driver cache load error (#23656)
log error: `W20230830 11:19:47.495721 3046231 status.h:363] meet error status: [INTERNAL_ERROR]user function's name should be function_id.checksum[.file_name].file_type, now the all split parts are by delimiter(.): 7119053928154065546.20c8228267b6c9ce620fddb39467d3eb.postgresql-42.5.0.jar` When the jdbc driver had `.` in its name we failed to split it properly
This commit is contained in:
@ -16,3 +16,31 @@
|
||||
// under the License.
|
||||
|
||||
#include "runtime/user_function_cache.h"
|
||||
|
||||
#include <gtest/gtest-message.h>
|
||||
#include <gtest/gtest-test-part.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace doris {
|
||||
|
||||
class UserFunctionCacheTest : public ::testing::Test {
|
||||
protected:
|
||||
UserFunctionCache ufc;
|
||||
};
|
||||
|
||||
TEST_F(UserFunctionCacheTest, SplitStringByChecksumTest) {
|
||||
// Test valid string format
|
||||
std::string valid_str =
|
||||
"7119053928154065546.20c8228267b6c9ce620fddb39467d3eb.postgresql-42.5.0.jar";
|
||||
auto result = ufc._split_string_by_checksum(valid_str);
|
||||
ASSERT_EQ(result.size(), 4);
|
||||
EXPECT_EQ(result[0], "7119053928154065546");
|
||||
EXPECT_EQ(result[1], "20c8228267b6c9ce620fddb39467d3eb");
|
||||
EXPECT_EQ(result[2], "postgresql-42.5.0");
|
||||
EXPECT_EQ(result[3], "jar");
|
||||
}
|
||||
|
||||
} // namespace doris
|
||||
|
||||
Reference in New Issue
Block a user