Skip to content

Commit

Permalink
feat: add boolean aggregate functions (#12)
Browse files Browse the repository at this point in the history
* feat: add boolean aggregate functions

* fix: remove aggregate functions from velox
  • Loading branch information
richtia authored Jul 26, 2023
1 parent 4b31a31 commit cb9a0a4
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 0 deletions.
60 changes: 60 additions & 0 deletions cases/boolean/bool_and.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
function: bool_and
cases:
- group:
id: basic
description: Basic examples without any special cases
args:
- value: [true true]
type: boolean
result:
value: true
type: boolean
- group: basic
args:
- value: [true false]
type: boolean
result:
value: false
type: boolean
- group: basic
args:
- value: [false false]
type: boolean
result:
value: false
type: boolean
- group: basic
args:
- value: [true]
type: boolean
result:
value: true
type: boolean
- group: basic
args:
- value: [true null]
type: boolean
result:
value: true
type: boolean
- group: basic
args:
- value: [null null]
type: boolean
result:
value: null
type: boolean
- group: basic
args:
- value: [false null]
type: boolean
result:
value: false
type: boolean
- group: basic
args:
- value: []
type: boolean
result:
value: null
type: boolean
67 changes: 67 additions & 0 deletions cases/boolean/bool_or.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
function: bool_or
cases:
- group:
id: basic
description: Basic examples without any special cases
args:
- value: [true true]
type: boolean
result:
value: true
type: boolean
- group: basic
args:
- value: [false false]
type: boolean
result:
value: false
type: boolean
- group: basic
args:
- value: [true false]
type: boolean
result:
value: true
type: boolean
- group: basic
args:
- value: [false]
type: boolean
result:
value: false
type: boolean
- group: basic
args:
- value: [true]
type: boolean
result:
value: true
type: boolean
- group: basic
args:
- value: [true null]
type: boolean
result:
value: true
type: boolean
- group: basic
args:
- value: [null null]
type: boolean
result:
value: null
type: boolean
- group: basic
args:
- value: [false null]
type: boolean
result:
value: false
type: boolean
- group: basic
args:
- value: []
type: boolean
result:
value: null
type: boolean
4 changes: 4 additions & 0 deletions dialects/datafusion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ aggregate_functions:
overflow: SILENT
- name: count
aggregate: True
- name: bool_and
unsupported: true
- name: bool_or
unsupported: true
4 changes: 4 additions & 0 deletions dialects/duckdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,7 @@ aggregate_functions:
result: i64
- name: count
aggregate: True
- name: bool_and
aggregate: True
- name: bool_or
aggregate: True
4 changes: 4 additions & 0 deletions dialects/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,7 @@ aggregate_functions:
- args:
- i8
result: i8
- name: bool_and
aggregate: True
- name: bool_or
aggregate: True
4 changes: 4 additions & 0 deletions dialects/sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,7 @@ aggregate_functions:
aggregate: True
- name: count
aggregate: True
- name: bool_and
unsupported: true
- name: bool_or
unsupported: true
4 changes: 4 additions & 0 deletions dialects/velox_presto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,7 @@ aggregate_functions:
unsupported: True
- name: count
unsupported: True
- name: bool_and
unsupported: True
- name: bool_or
unsupported: True

0 comments on commit cb9a0a4

Please sign in to comment.