Skip to content

Commit

Permalink
feat: confluentinc#2583 round only with precision
Browse files Browse the repository at this point in the history
  • Loading branch information
ouertani committed Jul 5, 2019
1 parent b8b750b commit 759a957
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"comments": [
"Tests covering the use of the ROUND(DOUBLE), ROUND(DOUBLE,INT), FLOOR(DOUBLE), FLOOR(DOUBLE,INT) function."
"Tests covering the use of the ROUND(DOUBLE), FLOOR(DOUBLE), CEIL(DOUBLE) functions."
],
"tests": [
{
Expand Down Expand Up @@ -32,7 +32,7 @@
"name": "calculate FLOOR function",
"statements": [
"CREATE STREAM test (v DOUBLE) WITH (kafka_topic='test_topic', value_format='JSON');",
"CREATE STREAM OUTPUT AS SELECT FLOOR(v) as F0, FLOOR(v, 0) as F00, FLOOR(v, 1) as F1, FLOOR(v, 2) as F2, FLOOR(v, 10) as F10 FROM test;"
"CREATE STREAM OUTPUT AS SELECT FLOOR(v) as F0 FROM test;"
],
"inputs": [
{"topic": "test_topic", "value": {"v" : 1.2}},
Expand All @@ -44,20 +44,20 @@
{"topic": "test_topic", "value": {"v" : null}}
],
"outputs": [
{"topic": "OUTPUT", "value": {"F0" : 1, "F00" : 1.0, "F1" : 1.2, "F2" : 1.2, "F10" : 1.2}},
{"topic": "OUTPUT", "value": {"F0" : 1, "F00" : 1.0, "F1" : 1.7, "F2" : 1.7, "F10" : 1.7}},
{"topic": "OUTPUT", "value": {"F0" : 1, "F00" : 1.0, "F1" : 1.5, "F2" : 1.5, "F10" : 1.5}},
{"topic": "OUTPUT", "value": {"F0" : 3, "F00" : 3.0, "F1" : 3.0, "F2" : 3.0, "F10" : 3.0}},
{"topic": "OUTPUT", "value": {"F0" : 1, "F00" : 1.0, "F1" : 1.2, "F2" : 1.23, "F10" : 1.234567}},
{"topic": "OUTPUT", "value": {"F0" : 0, "F00" : 0.0, "F1" : 0.0, "F2" : 0.0, "F10" : 0.0}},
{"topic": "OUTPUT", "value": {"F0" : null, "F00" : null, "F1" : null, "F2" : null, "F10" : null}}
{"topic": "OUTPUT", "value": {"F0" : 1}},
{"topic": "OUTPUT", "value": {"F0" : 1}},
{"topic": "OUTPUT", "value": {"F0" : 1}},
{"topic": "OUTPUT", "value": {"F0" : 3}},
{"topic": "OUTPUT", "value": {"F0" : 1}},
{"topic": "OUTPUT", "value": {"F0" : 0}},
{"topic": "OUTPUT", "value": {"F0" : null}}
]
},
{
"name": "calculate CEIL function",
"statements": [
"CREATE STREAM test (v DOUBLE) WITH (kafka_topic='test_topic', value_format='JSON');",
"CREATE STREAM OUTPUT AS SELECT CEIL(v) as C0, CEIL(v, 0) as C00, CEIL(v, 1) as C1, CEIL(v, 2) as C2, CEIL(v, 10) as C10 FROM test;"
"CREATE STREAM OUTPUT AS SELECT CEIL(v) as C0 FROM test;"
],
"inputs": [
{"topic": "test_topic", "value": {"v" : 1.2}},
Expand All @@ -69,13 +69,13 @@
{"topic": "test_topic", "value": {"v" : null}}
],
"outputs": [
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0, "C1" : 1.2, "C2" : 1.2, "C10" : 1.2}},
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0, "C1" : 1.7, "C2" : 1.7, "C10" : 1.7}},
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0, "C1" : 1.5, "C2" : 1.5, "C10" : 1.5}},
{"topic": "OUTPUT", "value": {"C0" : 3, "C00" : 3.0, "C1" : 3.0, "C2" : 3.0, "C10" : 3.0}},
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0, "C1" : 1.3, "C2" : 1.24, "C10" : 1.234567}},
{"topic": "OUTPUT", "value": {"C0" : 0, "C00" : 0.0, "C1" : 0.0, "C2" : 0.0, "C10" : 0.0}},
{"topic": "OUTPUT", "value": {"C0" : null, "C00" : null, "C1" : null, "C2" : null, "C10" : null}}
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0}},
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0}},
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0}},
{"topic": "OUTPUT", "value": {"C0" : 3, "C00" : 3.0}},
{"topic": "OUTPUT", "value": {"C0" : 2, "C00" : 2.0}},
{"topic": "OUTPUT", "value": {"C0" : 0, "C00" : 0.0}},
{"topic": "OUTPUT", "value": {"C0" : null}}
]
}
]
Expand Down

0 comments on commit 759a957

Please sign in to comment.