Browse Source

passthrough string kernels

chertus 2 years ago
parent
commit
3e7759b138

+ 9 - 0
ydb/core/formats/program.cpp

@@ -123,6 +123,12 @@ const char * GetFunctionName(EOperation op) {
             return "binary_length";
         case EOperation::MatchSubstring:
             return "match_substring";
+        case EOperation::MatchLike:
+            return "match_like";
+        case EOperation::StartsWith:
+            return "starts_with";
+        case EOperation::EndsWith:
+            return "ends_with";
 
         case EOperation::Acosh:
             return "acosh";
@@ -187,6 +193,9 @@ EOperation ValidateOperation(EOperation op, ui32 argsSize) {
         case EOperation::Greater:
         case EOperation::GreaterEqual:
         case EOperation::MatchSubstring:
+        case EOperation::MatchLike:
+        case EOperation::StartsWith:
+        case EOperation::EndsWith:
         case EOperation::And:
         case EOperation::Or:
         case EOperation::Xor:

+ 3 - 0
ydb/core/protos/ssa.proto

@@ -74,6 +74,9 @@ message TProgram {
             FUNC_CAST_TO_BINARY = 29;
             FUNC_CAST_TO_FIXED_SIZE_BINARY = 30;
             FUNC_CAST_TO_TIMESTAMP = 31;
+            FUNC_STR_MATCH_LIKE = 32;
+            FUNC_STR_STARTS_WITH = 33;
+            FUNC_STR_ENDS_WITH = 34;
         }
 
         message TFunction {

+ 6 - 0
ydb/core/tx/columnshard/columnshard_common.cpp

@@ -108,6 +108,12 @@ TAssign MakeFunction(const TContext& info, const std::string& name,
             return TAssign(name, EOperation::BinaryLength, std::move(arguments));
         case TId::FUNC_STR_MATCH:
             return TAssign(name, EOperation::MatchSubstring, std::move(arguments));
+        case TId::FUNC_STR_MATCH_LIKE:
+            return TAssign(name, EOperation::MatchLike, std::move(arguments));
+        case TId::FUNC_STR_STARTS_WITH:
+            return TAssign(name, EOperation::StartsWith, std::move(arguments));
+        case TId::FUNC_STR_ENDS_WITH:
+            return TAssign(name, EOperation::EndsWith, std::move(arguments));
         case TId::FUNC_BINARY_NOT:
             return TAssign(name, EOperation::Invert, std::move(arguments));
         case TId::FUNC_BINARY_AND:

+ 3 - 0
ydb/library/arrow_kernels/operations.h

@@ -52,6 +52,9 @@ enum class EOperation {
     //
     BinaryLength,
     MatchSubstring,
+    MatchLike,
+    StartsWith,
+    EndsWith,
     // math
     Acosh,
     Atanh,