diff --git a/bft/testers/velox/runner.py b/bft/testers/velox/runner.py index 3483f3bb..fc7438fa 100644 --- a/bft/testers/velox/runner.py +++ b/bft/testers/velox/runner.py @@ -5,7 +5,7 @@ def is_type_supported(type): - return type in set({"i64", "fp64", "boolean"}) + return type in set({"i64", "fp64", "boolean", "string"}) class VeloxRunner(SqlCaseRunner): diff --git a/cases/string/substring.yaml b/cases/string/substring.yaml index a4b2253b..51b56d6a 100644 --- a/cases/string/substring.yaml +++ b/cases/string/substring.yaml @@ -13,6 +13,17 @@ cases: result: value: 'abcde' type: string + - group: basic + args: + - value: 'abcdefg' + type: string + - value: 1 + type: i64 + - value: 5 + type: i64 + result: + value: 'abcde' + type: string - group: id: negative_start description: Example where start argument is a negative integer @@ -26,6 +37,17 @@ cases: result: value: 'ef' type: string + - group: negative_start + args: + - value: 'abcdefg' + type: string + - value: -3 + type: i64 + - value: 2 + type: i64 + result: + value: 'ef' + type: string - group: id: start_greater_than_length description: Example where start argument greater than the length of the string @@ -39,6 +61,17 @@ cases: result: value: '' type: string + - group: start_greater_than_length + args: + - value: 'abcdefg' + type: string + - value: 10 + type: i64 + - value: 2 + type: i64 + result: + value: '' + type: string - group: id: multi_byte_characters description: Example where multi byte characters exist in the string @@ -52,3 +85,14 @@ cases: result: value: '😊a😊' type: string + - group: multi_byte_characters + args: + - value: '😊a😊b😊😊' + type: string + - value: 1 + type: i64 + - value: 3 + type: i64 + result: + value: '😊a😊' + type: string diff --git a/dialects/postgres.yaml b/dialects/postgres.yaml index 319a6f9b..e82d5867 100644 --- a/dialects/postgres.yaml +++ b/dialects/postgres.yaml @@ -219,6 +219,12 @@ scalar_functions: - i32 result: fp64 - name: substring + unsupported_kernels: + - args: + - string + - i64 + - i64 + result: string - name: concat local_name: "||" infix: True diff --git a/dialects/velox_presto.yaml b/dialects/velox_presto.yaml index f761da69..4eee9344 100644 --- a/dialects/velox_presto.yaml +++ b/dialects/velox_presto.yaml @@ -287,5 +287,11 @@ scalar_functions: result: fp64 - name: substring local_name: substr + unsupported_kernels: + - args: + - string + - i32 + - i32 + result: string - name: concat - name: like