Skip to content

Commit

Permalink
test: use i32 and i64 substring args for postgres vs velox
Browse files Browse the repository at this point in the history
  • Loading branch information
richtia committed May 31, 2023
1 parent ad4dc33 commit 1de58ae
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
44 changes: 44 additions & 0 deletions cases/string/substring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ cases:
- group:
id: basic
description: Basic examples without any special cases
args:
- value: 'abcdefg'
type: string
- value: 1
type: i32
- value: 5
type: i32
result:
value: 'abcde'
type: string
- group: basic
args:
- value: 'abcdefg'
type: string
Expand All @@ -16,6 +27,17 @@ cases:
- group:
id: negative_start
description: Example where start argument is a negative integer
args:
- value: 'abcdefg'
type: string
- value: -3
type: i32
- value: 2
type: i32
result:
value: 'ef'
type: string
- group: negative_start
args:
- value: 'abcdefg'
type: string
Expand All @@ -29,6 +51,17 @@ cases:
- group:
id: start_greater_than_length
description: Example where start argument greater than the length of the string
args:
- value: 'abcdefg'
type: string
- value: 10
type: i32
- value: 2
type: i32
result:
value: ''
type: string
- group: start_greater_than_length
args:
- value: 'abcdefg'
type: string
Expand All @@ -42,6 +75,17 @@ cases:
- group:
id: multi_byte_characters
description: Example where multi byte characters exist in the string
args:
- value: '😊a😊b😊😊'
type: string
- value: 1
type: i32
- value: 3
type: i32
result:
value: '😊a😊'
type: string
- group: multi_byte_characters
args:
- value: '😊a😊b😊😊'
type: string
Expand Down
5 changes: 5 additions & 0 deletions dialects/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ scalar_functions:
- i32
result: fp64
- name: substring
unsupported_kernels:
- args:
- i64
- i64
result: string
- name: concat
local_name: "||"
infix: True
Expand Down
5 changes: 5 additions & 0 deletions dialects/velox_presto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,10 @@ scalar_functions:
result: fp64
- name: substring
local_name: substr
unsupported_kernels:
- args:
- i32
- i32
result: string
- name: concat
- name: like

0 comments on commit 1de58ae

Please sign in to comment.