From 1a092256c7b0cfa44420363b5ef39d9ee9b5db5a Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Sat, 21 May 2022 23:01:33 +0800 Subject: [PATCH 01/15] fix: Resolve compiling warnings #1826 --- src/nameserver/name_server_test.cc | 1 - src/tablet/tablet_impl_multi_path_test.cc | 8 ++++---- src/tablet/tablet_impl_projection_test.cc | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/nameserver/name_server_test.cc b/src/nameserver/name_server_test.cc index 30ad09c02ae..a77d5002525 100644 --- a/src/nameserver/name_server_test.cc +++ b/src/nameserver/name_server_test.cc @@ -297,7 +297,6 @@ TEST_P(NameServerImplTest, MakesnapshotTask) { } TEST_P(NameServerImplTest, ConfigGetAndSet) { - openmldb::common::StorageMode storage_mode = GetParam(); FLAGS_zk_cluster = "127.0.0.1:6181"; FLAGS_zk_root_path = "/rtidb3" + ::openmldb::test::GenRand(); diff --git a/src/tablet/tablet_impl_multi_path_test.cc b/src/tablet/tablet_impl_multi_path_test.cc index 7932c728635..c67acf48a8a 100644 --- a/src/tablet/tablet_impl_multi_path_test.cc +++ b/src/tablet/tablet_impl_multi_path_test.cc @@ -70,22 +70,22 @@ class DiskTestEnvironment : public ::testing::Environment{ virtual void SetUp() { std::vector file_path; ::openmldb::base::SplitString(FLAGS_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } ::openmldb::base::SplitString(FLAGS_recycle_bin_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } } virtual void TearDown() { std::vector file_path; ::openmldb::base::SplitString(FLAGS_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } ::openmldb::base::SplitString(FLAGS_recycle_bin_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } } diff --git a/src/tablet/tablet_impl_projection_test.cc b/src/tablet/tablet_impl_projection_test.cc index f8d00985afb..5f70b50bb51 100644 --- a/src/tablet/tablet_impl_projection_test.cc +++ b/src/tablet/tablet_impl_projection_test.cc @@ -81,22 +81,22 @@ class DiskTestEnvironment : public ::testing::Environment{ virtual void SetUp() { std::vector file_path; ::openmldb::base::SplitString(FLAGS_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } ::openmldb::base::SplitString(FLAGS_recycle_bin_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } } virtual void TearDown() { std::vector file_path; ::openmldb::base::SplitString(FLAGS_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } ::openmldb::base::SplitString(FLAGS_recycle_bin_hdd_root_path, ",", file_path); - for (int i = 0; i < file_path.size(); i++) { + for (uint32_t i = 0; i < file_path.size(); i++) { ::openmldb::base::RemoveDirRecursive(file_path[i]); } } From 81cf88f592fff76c156c6cc281440fc9cb1ae9cc Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Sat, 21 May 2022 23:55:21 +0800 Subject: [PATCH 02/15] fix: Resolve the JavaDoc warning of openmldb-jdbc #1319 --- .../main/java/com/_4paradigm/openmldb/jdbc/SQLResultSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/jdbc/SQLResultSet.java b/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/jdbc/SQLResultSet.java index 1ac5ce5d91b..4565f366998 100644 --- a/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/jdbc/SQLResultSet.java +++ b/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/jdbc/SQLResultSet.java @@ -330,7 +330,7 @@ public InputStream getAsciiStream(String s) throws SQLException { } /** - * @param s + * @param s the string for the unicode stream extraction. * @deprecated */ @Override From 4e943ce112b56533cf68ab4f3f7bab12bae6b40c Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Sun, 22 May 2022 00:04:23 +0800 Subject: [PATCH 03/15] fix: Resolve the JavaDoc warning of openmldb-jdbc - complete --- .../com/_4paradigm/openmldb/common/LibraryLoader.java | 5 +++++ .../java/com/_4paradigm/openmldb/sdk/QueryFuture.java | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/common/LibraryLoader.java b/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/common/LibraryLoader.java index b20e33f05fa..a4b47a2268b 100644 --- a/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/common/LibraryLoader.java +++ b/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/common/LibraryLoader.java @@ -87,8 +87,13 @@ synchronized public static void loadLibrary(String libraryPath) { } } + /** * Extract library in resource into filesystem + * @param path the path that will be extracted. + * @param isTemp true if a temp file is created, otherwise false. + * @return the absolute path of the resources. + * @throws IOException if the resources cannot be found. */ public static String extractResource(String path, boolean isTemp) throws IOException { InputStream inputStream = LibraryLoader.class.getClassLoader().getResourceAsStream(path); diff --git a/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/QueryFuture.java b/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/QueryFuture.java index fa7e269350d..36f50a79448 100644 --- a/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/QueryFuture.java +++ b/java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/sdk/QueryFuture.java @@ -70,11 +70,11 @@ public java.sql.ResultSet get() throws InterruptedException, ExecutionException /** * * @param l current timeout set by executeQeuryAsyn, so the param is invalid - * @param timeUnit - * @return - * @throws InterruptedException - * @throws ExecutionException - * @throws TimeoutException + * @param timeUnit the time unit of the timeout, which is also invalid. + * @return the result of the query from the database + * @throws InterruptedException throws when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity. + * @throws ExecutionException throws when attempting to retrieve the result of a task that aborted by throwing an exception. + * @throws TimeoutException throws when a blocking operation times out. */ @Override @Deprecated From 9fd80002316561ddf3beb7dd0ea5082df8370803 Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Mon, 23 May 2022 15:51:26 +0800 Subject: [PATCH 04/15] fixed null val --- .../com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala | 2 +- .../com/_4paradigm/openmldb/batch/window/WindowComputer.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala index f7abcfe86e4..4e761848311 100755 --- a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala +++ b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala @@ -730,7 +730,7 @@ object WindowAggPlan { - def isValidOrder(key: Long): Boolean = { + def isValidOrder(key: java.lang.Long): Boolean = { // TODO: Ignore the null value, maybe handle null in the future if (key == null) { false diff --git a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala index 60acab146eb..7ecbd0e6a4f 100644 --- a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala +++ b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala @@ -222,7 +222,7 @@ class WindowComputer(config: WindowAggConfig, jit: HybridSeJitWrapper, keepIndex config.startOffset, config.endOffset, config.rowPreceding, config.maxSize) } - def extractKey(curRow: Row): Long = { + def extractKey(curRow: Row): java.lang.Long = { SparkRowUtil.getLongFromIndex(config.orderIdx, orderField.dataType, curRow) } From 8f6dec45ed167f4e998488412207e288bde25762 Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Thu, 26 May 2022 22:15:42 +0800 Subject: [PATCH 05/15] add --- hybridse/src/codegen/udf_ir_builder_test.cc | 8 ++++++++ hybridse/src/udf/default_udf_library.cc | 13 +++++++++++++ hybridse/src/udf/udf.cc | 9 +++++++++ hybridse/src/udf/udf.h | 5 +++++ 4 files changed, 35 insertions(+) diff --git a/hybridse/src/codegen/udf_ir_builder_test.cc b/hybridse/src/codegen/udf_ir_builder_test.cc index b8388ebe6c3..0ac89c4c407 100644 --- a/hybridse/src/codegen/udf_ir_builder_test.cc +++ b/hybridse/src/codegen/udf_ir_builder_test.cc @@ -1007,6 +1007,14 @@ TEST_F(UdfIRBuilderTest, degrees) { CheckUdf(udf_name, -90.0, -pi/2); CheckUdf, Nullable>(udf_name, nullptr, nullptr); } + +TEST_F(UdfIRBuilderTest, char_length_udf_test) { + auto udf_name = "char_length"; + CheckUdf(udf_name, 10, "Spark SQL "); + CheckUdf>(udf_name, 0, ""); + CheckUdf>(udf_name, 0, nullptr); +} + } // namespace codegen } // namespace hybridse diff --git a/hybridse/src/udf/default_udf_library.cc b/hybridse/src/udf/default_udf_library.cc index 27f84fa5683..9519938d48e 100644 --- a/hybridse/src/udf/default_udf_library.cc +++ b/hybridse/src/udf/default_udf_library.cc @@ -895,6 +895,19 @@ void DefaultUdfLibrary::InitStringUdf() { @since 0.4.0)"); RegisterAlias("lower", "lcase"); RegisterAlias("upper", "ucase"); + RegisterExternal("char_length") + .args(static_cast(udf::v1::char_length)) + .doc(R"( + @brief Returns the length of the string. + + Example: + + @code{.sql} + SELECT CHAR_LENGTH('Spark SQL '); + --output 10 + @endcode + @since 0.5.0)"); + RegisterAlias("character_length","char_length"); } void DefaultUdfLibrary::InitMathUdf() { diff --git a/hybridse/src/udf/udf.cc b/hybridse/src/udf/udf.cc index 31781ea7363..3d7058381b7 100644 --- a/hybridse/src/udf/udf.cc +++ b/hybridse/src/udf/udf.cc @@ -157,6 +157,15 @@ int32_t weekofyear(Date *date) { } } +int32_t char_length(StringRef *str){ + if (nullptr == str) { + return 0; + } + std::string words = str->ToString(); + int32_t res = words.length(); + return res; +} + float Cotf(float x) { return cosf(x) / sinf(x); } double Degrees(double x) { return x * (180 / 3.141592653589793238463L); } diff --git a/hybridse/src/udf/udf.h b/hybridse/src/udf/udf.h index 1fca943fd31..3b1b4d15054 100644 --- a/hybridse/src/udf/udf.h +++ b/hybridse/src/udf/udf.h @@ -224,6 +224,8 @@ int32_t weekofyear(int64_t ts); int32_t weekofyear(Timestamp *ts); int32_t weekofyear(Date *ts); +int32_t char_length(StringRef *str); + float Cotf(float x); double Degrees(double x); @@ -271,6 +273,9 @@ void lcase(StringRef *str, StringRef *output, bool *is_null_ptr); void ucase(StringRef *str, StringRef *output, bool *is_null_ptr); void init_udfcontext(UDFContext* context); void trivial_fun(); + + + /** * Allocate string buffer from jit runtime. */ From 5b52f013302e72a81ace52a3b4c0f3356e98afa1 Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Thu, 26 May 2022 22:34:30 +0800 Subject: [PATCH 06/15] revise --- .../com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala | 2 +- .../com/_4paradigm/openmldb/batch/window/WindowComputer.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala index 4e761848311..f7abcfe86e4 100755 --- a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala +++ b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala @@ -730,7 +730,7 @@ object WindowAggPlan { - def isValidOrder(key: java.lang.Long): Boolean = { + def isValidOrder(key: Long): Boolean = { // TODO: Ignore the null value, maybe handle null in the future if (key == null) { false diff --git a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala index 7ecbd0e6a4f..60acab146eb 100644 --- a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala +++ b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala @@ -222,7 +222,7 @@ class WindowComputer(config: WindowAggConfig, jit: HybridSeJitWrapper, keepIndex config.startOffset, config.endOffset, config.rowPreceding, config.maxSize) } - def extractKey(curRow: Row): java.lang.Long = { + def extractKey(curRow: Row): Long = { SparkRowUtil.getLongFromIndex(config.orderIdx, orderField.dataType, curRow) } From 9df3a15c71b151ba2ccaf66c6d37d28963d7ebcb Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Thu, 26 May 2022 23:32:53 +0800 Subject: [PATCH 07/15] reset --- .../com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala | 2 +- .../com/_4paradigm/openmldb/batch/window/WindowComputer.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala index 4e761848311..f7abcfe86e4 100755 --- a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala +++ b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/nodes/WindowAggPlan.scala @@ -730,7 +730,7 @@ object WindowAggPlan { - def isValidOrder(key: java.lang.Long): Boolean = { + def isValidOrder(key: Long): Boolean = { // TODO: Ignore the null value, maybe handle null in the future if (key == null) { false diff --git a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala index 7ecbd0e6a4f..60acab146eb 100644 --- a/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala +++ b/java/openmldb-batch/src/main/scala/com/_4paradigm/openmldb/batch/window/WindowComputer.scala @@ -222,7 +222,7 @@ class WindowComputer(config: WindowAggConfig, jit: HybridSeJitWrapper, keepIndex config.startOffset, config.endOffset, config.rowPreceding, config.maxSize) } - def extractKey(curRow: Row): java.lang.Long = { + def extractKey(curRow: Row): Long = { SparkRowUtil.getLongFromIndex(config.orderIdx, orderField.dataType, curRow) } From 5509c37554604add0b5db33d576e2424f0add64e Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 00:03:19 +0800 Subject: [PATCH 08/15] add stringref --- hybridse/src/codegen/udf_ir_builder_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hybridse/src/codegen/udf_ir_builder_test.cc b/hybridse/src/codegen/udf_ir_builder_test.cc index 0ac89c4c407..b191649cb8c 100644 --- a/hybridse/src/codegen/udf_ir_builder_test.cc +++ b/hybridse/src/codegen/udf_ir_builder_test.cc @@ -1010,8 +1010,8 @@ TEST_F(UdfIRBuilderTest, degrees) { TEST_F(UdfIRBuilderTest, char_length_udf_test) { auto udf_name = "char_length"; - CheckUdf(udf_name, 10, "Spark SQL "); - CheckUdf>(udf_name, 0, ""); + CheckUdf(udf_name, 10, StringRef("Spark SQL ")); + CheckUdf>(udf_name, 0, StringRef("")); CheckUdf>(udf_name, 0, nullptr); } From 619f8197aaddaefb39cb6118e5ad0231c504987e Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 18:40:44 +0800 Subject: [PATCH 09/15] Update default_udf_library.cc --- hybridse/src/udf/default_udf_library.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hybridse/src/udf/default_udf_library.cc b/hybridse/src/udf/default_udf_library.cc index d877ef56b5d..824b094ae6a 100644 --- a/hybridse/src/udf/default_udf_library.cc +++ b/hybridse/src/udf/default_udf_library.cc @@ -898,7 +898,7 @@ void DefaultUdfLibrary::InitStringUdf() { RegisterExternal("char_length") .args(static_cast(udf::v1::char_length)) .doc(R"( - @brief Returns the length of the string. + @brief Returns the length of the string. It is measured in characters and multibyte character string is not supported. Example: @@ -906,8 +906,8 @@ void DefaultUdfLibrary::InitStringUdf() { SELECT CHAR_LENGTH('Spark SQL '); --output 10 @endcode - @since 0.5.0)"); - RegisterAlias("character_length","char_length"); + @since 0.6.0)"); + RegisterAlias("character_length", "char_length"); } void DefaultUdfLibrary::InitMathUdf() { From 00e46001971534dcb51ae7d06d5d19f812a18e59 Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 18:41:44 +0800 Subject: [PATCH 10/15] Update udf.cc --- hybridse/src/udf/udf.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hybridse/src/udf/udf.cc b/hybridse/src/udf/udf.cc index 3d7058381b7..b504acbb741 100644 --- a/hybridse/src/udf/udf.cc +++ b/hybridse/src/udf/udf.cc @@ -161,8 +161,7 @@ int32_t char_length(StringRef *str){ if (nullptr == str) { return 0; } - std::string words = str->ToString(); - int32_t res = words.length(); + int32_t res = str->size_; return res; } From 67fb7d748860cb76e8b84997f6f054ea4df9c9b8 Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 18:42:23 +0800 Subject: [PATCH 11/15] Update udf.h --- hybridse/src/udf/udf.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/hybridse/src/udf/udf.h b/hybridse/src/udf/udf.h index 3b1b4d15054..13309e8b253 100644 --- a/hybridse/src/udf/udf.h +++ b/hybridse/src/udf/udf.h @@ -274,8 +274,6 @@ void ucase(StringRef *str, StringRef *output, bool *is_null_ptr); void init_udfcontext(UDFContext* context); void trivial_fun(); - - /** * Allocate string buffer from jit runtime. */ From aa394ac06a1295e0df1560f687430357e738b3cf Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 18:43:25 +0800 Subject: [PATCH 12/15] Update udf_ir_builder_test.cc --- hybridse/src/codegen/udf_ir_builder_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/hybridse/src/codegen/udf_ir_builder_test.cc b/hybridse/src/codegen/udf_ir_builder_test.cc index b191649cb8c..d65a7fd1cae 100644 --- a/hybridse/src/codegen/udf_ir_builder_test.cc +++ b/hybridse/src/codegen/udf_ir_builder_test.cc @@ -1011,6 +1011,7 @@ TEST_F(UdfIRBuilderTest, degrees) { TEST_F(UdfIRBuilderTest, char_length_udf_test) { auto udf_name = "char_length"; CheckUdf(udf_name, 10, StringRef("Spark SQL ")); + CheckUdf(udf_name, 10, StringRef("Spark SQL\n")); CheckUdf>(udf_name, 0, StringRef("")); CheckUdf>(udf_name, 0, nullptr); } From 62936d861b9f7bf42dc35313d54951b224d7fe13 Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 19:31:10 +0800 Subject: [PATCH 13/15] Update default_udf_library.cc --- hybridse/src/udf/default_udf_library.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hybridse/src/udf/default_udf_library.cc b/hybridse/src/udf/default_udf_library.cc index 824b094ae6a..4880e0a924c 100644 --- a/hybridse/src/udf/default_udf_library.cc +++ b/hybridse/src/udf/default_udf_library.cc @@ -907,7 +907,7 @@ void DefaultUdfLibrary::InitStringUdf() { --output 10 @endcode @since 0.6.0)"); - RegisterAlias("character_length", "char_length"); + RegisterAlias("character_length", "char_length"); } void DefaultUdfLibrary::InitMathUdf() { From 8a938bc3657926ad24b50714f0996b60efc3877a Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 19:32:12 +0800 Subject: [PATCH 14/15] Update udf.cc --- hybridse/src/udf/udf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hybridse/src/udf/udf.cc b/hybridse/src/udf/udf.cc index b504acbb741..95407bae6fb 100644 --- a/hybridse/src/udf/udf.cc +++ b/hybridse/src/udf/udf.cc @@ -157,7 +157,7 @@ int32_t weekofyear(Date *date) { } } -int32_t char_length(StringRef *str){ +int32_t char_length(StringRef *str) { if (nullptr == str) { return 0; } From b6f917ede8202d58a6ff77f49d668e177e0836ec Mon Sep 17 00:00:00 2001 From: Wu Wenhan <1020645987@qq.com> Date: Fri, 27 May 2022 19:34:27 +0800 Subject: [PATCH 15/15] Update udf.h --- hybridse/src/udf/udf.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/hybridse/src/udf/udf.h b/hybridse/src/udf/udf.h index 13309e8b253..1538a1c7973 100644 --- a/hybridse/src/udf/udf.h +++ b/hybridse/src/udf/udf.h @@ -225,7 +225,6 @@ int32_t weekofyear(Timestamp *ts); int32_t weekofyear(Date *ts); int32_t char_length(StringRef *str); - float Cotf(float x); double Degrees(double x); @@ -273,7 +272,6 @@ void lcase(StringRef *str, StringRef *output, bool *is_null_ptr); void ucase(StringRef *str, StringRef *output, bool *is_null_ptr); void init_udfcontext(UDFContext* context); void trivial_fun(); - /** * Allocate string buffer from jit runtime. */