Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: better error message on illegal arithmetic with NULL values #7554

Merged
merged 13 commits into from
May 20, 2021
Prev Previous commit
Next Next commit
remove QTT
  • Loading branch information
Chittaranjan Prasad committed May 20, 2021
commit 2412bcd7a608cba0754992065c66d7a8465c6cad
Original file line number Diff line number Diff line change
Expand Up @@ -256,61 +256,6 @@
}
]
}
},
{
"name": "NULL Arithmetic Behavior - INTEGER addition",
"statements": [
"CREATE STREAM INPUT (ID INT) WITH (kafka_topic='test_topic', value_format='JSON');",
"SELECT 1 + NULL FROM INPUT EMIT CHANGES;"
],
"expectedException": {
"type": "io.confluent.ksql.util.KsqlStatementException",
"message": "Error processing expression: (1 + null). Arithmetic on types INTEGER and null are not supported."
}
},
{
"name": "NULL Arithmetic Behavior - MAP addition",
"statements": [
"CREATE STREAM INPUT (ID INT) WITH (kafka_topic='test_topic', value_format='JSON');",
"SELECT MAP(1 := 'cat') + NULL FROM INPUT EMIT CHANGES;"
],
"expectedException": {
"type": "io.confluent.ksql.util.KsqlStatementException",
"message": "Error processing expression: (MAP(1:='cat') + null). Arithmetic on types MAP<INTEGER, STRING> and null are not supported."
}
},
{
"name": "NULL Arithmetic Behavior - ARRAY addition",
"statements": [
"CREATE STREAM INPUT (ID INT) WITH (kafka_topic='test_topic', value_format='JSON');",
"SELECT Array[1,2,3] + NULL FROM INPUT EMIT CHANGES;"
],
"expectedException": {
"type": "io.confluent.ksql.util.KsqlStatementException",
"message": "Error processing expression: (ARRAY[1, 2, 3] + null). Arithmetic on types ARRAY<INTEGER> and null are not supported."
}
},
{
"name": "NULL Arithmetic Behavior - DECIMAL division",
"statements": [
"CREATE STREAM INPUT (ID INT) WITH (kafka_topic='test_topic', value_format='JSON');",
"SELECT 5.0 / NULL FROM INPUT EMIT CHANGES;"
],
"expectedException": {
"type": "io.confluent.ksql.util.KsqlStatementException",
"message": "Error processing expression: (5.0 / null). Arithmetic on types DECIMAL(2, 1) and null are not supported."
}
},
{
"name": "NULL Arithmetic Behavior - NULL NULL multiplication",
"statements": [
"CREATE STREAM INPUT (ID INT) WITH (kafka_topic='test_topic', value_format='JSON');",
"SELECT NULL * NULL FROM INPUT EMIT CHANGES;"
],
"expectedException": {
"type": "io.confluent.ksql.util.KsqlStatementException",
"message": "Error processing expression: (null * null). Arithmetic on types null and null are not supported."
}
}
]
}