Skip to content

Commit

Permalink
test: add string support to velox and use i64 for substring param
Browse files Browse the repository at this point in the history
  • Loading branch information
richtia committed May 31, 2023
1 parent 3eaf803 commit 7acb9db
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bft/testers/velox/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
44 changes: 44 additions & 0 deletions cases/string/substring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
6 changes: 6 additions & 0 deletions dialects/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions dialects/velox_presto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7acb9db

Please sign in to comment.