Skip to content

Commit

Permalink
Adds more aggregation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RCHowell committed Oct 11, 2023
1 parent 5d422da commit 90931ae
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions partiql-planner/src/testFixtures/resources/tests/aggregations.ion
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,150 @@ suite::{
},
},
},
'min(int32|null)': {
statement: '''
SELECT MIN(n) as "min" FROM numbers.nullable_int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "min",
type: [
"int32",
"null",
],
},
],
},
},
},
'max(int32|null)': {
statement: '''
SELECT MAX(n) as "max" FROM numbers.nullable_int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "max",
type: [
"int32",
"null",
],
},
],
},
},
},
'sum(int32|null)': {
statement: '''
SELECT SUM(n) as "sum" FROM numbers.nullable_int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "sum",
type: [
"int32",
"null",
],
},
],
},
},
},
'avg(int32)': {
statement: '''
SELECT AVG(n) as "avg" FROM numbers.int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "avg",
type: "int32"
},
],
},
},
},
'count(int32)': {
statement: '''
SELECT COUNT(n) as "count" FROM numbers.int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "count",
type: "int",
},
],
},
},
},
'min(int32)': {
statement: '''
SELECT MIN(n) as "min" FROM numbers.int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "min",
type: "int32"
},
],
},
},
},
'max(int32)': {
statement: '''
SELECT MAX(n) as "max" FROM numbers.int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "max",
type: "int32"
},
],
},
},
},
'sum(int32)': {
statement: '''
SELECT SUM(n) as "sum" FROM numbers.int32s AS n
''',
schema: {
type: "bag",
items: {
type: "struct",
fields: [
{
name: "sum",
type: "int32"
},
],
},
},
},
},
}

0 comments on commit 90931ae

Please sign in to comment.