You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/11/23 06:18:30 UTC

[GitHub] [pinot] 61yao opened a new pull request, #9850: [multistage][testing] Basic math func test and some more between test

61yao opened a new pull request, #9850:
URL: https://github.com/apache/pinot/pull/9850

   1) Add basic math func test 
   2) Add between literal test
   3) Add between test for string type


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] walterddr commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
walterddr commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1038297108


##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test multiply on integer columns",
+        "sql": "SELECT intCol * longCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on int literal with columns",
+        "sql": "SELECT intCol * 10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on double literal with columns",
+        "sql": "SELECT intCol * 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point",
+        "sql": "SELECT doubleCol * floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point with literal",
+        "sql": "SELECT doubleCol * 2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on zero",
+        "sql": "SELECT doubleCol * 0 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "division": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on integer columns",
+        "sql": "SELECT intCol / longCol FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on int literal with columns",
+        "sql": "SELECT intCol / 10 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on double literal with columns",
+        "sql": "SELECT intCol / 1.2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 5 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point",
+        "sql": "SELECT doubleCol / floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point with literal",
+        "sql": "SELECT doubleCol / 2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should throw infinity but we throw an exception",
+        "description": "test divide by zero",
+        "expectedException": ".*Division by zero.*",
+        "sql": "SELECT doubleCol / 0 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "mod": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "we are returning -0.0 for some reason",
+        "description": "test mod on integer columns",
+        "sql": "SELECT intCol % longCol FROM {numTbl}"
+      },
+      {
+        "description": "test mod on int literal with columns",
+        "sql": "SELECT intCol %  10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should return 0 for 0 value but we are not",
+        "description": "test mod on floating point literal with columns",
+        "sql": "SELECT intCol %  1.2 FROM {numTbl}"
+      },
+      {
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test mod on literals",
+        "sql": "SELECT 3 %  5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "diff due to floating point comparison",

Review Comment:
   i think there's already a fix so let's see if these passes now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] 61yao commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
61yao commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1039052374


##########
pinot-query-runtime/src/test/resources/queries/Comparisons.json:
##########
@@ -390,6 +390,7 @@
     "queries": [
       { "sql": "SELECT val BETWEEN small AND big FROM {tbl}" },
       { "sql": "SELECT val BETWEEN big AND small FROM {tbl}" },
+      { "sql": "SELECT val BETWEEN 2 AND 3 FROM {tbl}" },

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] walterddr merged pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
walterddr merged PR #9850:
URL: https://github.com/apache/pinot/pull/9850


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] codecov-commenter commented on pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #9850:
URL: https://github.com/apache/pinot/pull/9850#issuecomment-1324626639

   # [Codecov](https://codecov.io/gh/apache/pinot/pull/9850?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#9850](https://codecov.io/gh/apache/pinot/pull/9850?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9e50d12) into [master](https://codecov.io/gh/apache/pinot/commit/32314bb4335a455c474cab3a0710b363bd114cbd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (32314bb) will **decrease** coverage by `54.56%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #9850       +/-   ##
   =============================================
   - Coverage     70.33%   15.76%   -54.57%     
   + Complexity     5008      175     -4833     
   =============================================
     Files          1970     1919       -51     
     Lines        105665   103250     -2415     
     Branches      15989    15701      -288     
   =============================================
   - Hits          74318    16279    -58039     
   - Misses        26139    85776    +59637     
   + Partials       5208     1195     -4013     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration1 | `?` | |
   | integration2 | `?` | |
   | unittests1 | `?` | |
   | unittests2 | `15.76% <ø> (+0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pinot/pull/9850?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...src/main/java/org/apache/pinot/sql/FilterKind.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcWwvRmlsdGVyS2luZC5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...ain/java/org/apache/pinot/spi/utils/LoopUtils.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvTG9vcFV0aWxzLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...ain/java/org/apache/pinot/core/data/table/Key.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL3RhYmxlL0tleS5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...in/java/org/apache/pinot/spi/utils/BytesUtils.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvQnl0ZXNVdGlscy5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...n/java/org/apache/pinot/core/data/table/Table.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL3RhYmxlL1RhYmxlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../java/org/apache/pinot/core/data/table/Record.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL3RhYmxlL1JlY29yZC5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../java/org/apache/pinot/core/util/GroupByUtils.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS91dGlsL0dyb3VwQnlVdGlscy5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...java/org/apache/pinot/spi/trace/BaseRecording.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdHJhY2UvQmFzZVJlY29yZGluZy5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...java/org/apache/pinot/spi/trace/NoOpRecording.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdHJhY2UvTm9PcFJlY29yZGluZy5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...ava/org/apache/pinot/spi/config/table/FSTType.java](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvY29uZmlnL3RhYmxlL0ZTVFR5cGUuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [1466 more](https://codecov.io/gh/apache/pinot/pull/9850/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] agavra commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
agavra commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1033798740


##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test multiply on integer columns",
+        "sql": "SELECT intCol * longCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on int literal with columns",
+        "sql": "SELECT intCol * 10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on double literal with columns",
+        "sql": "SELECT intCol * 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point",
+        "sql": "SELECT doubleCol * floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point with literal",
+        "sql": "SELECT doubleCol * 2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on zero",
+        "sql": "SELECT doubleCol * 0 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "division": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on integer columns",
+        "sql": "SELECT intCol / longCol FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on int literal with columns",
+        "sql": "SELECT intCol / 10 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on double literal with columns",
+        "sql": "SELECT intCol / 1.2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 5 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point",
+        "sql": "SELECT doubleCol / floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point with literal",
+        "sql": "SELECT doubleCol / 2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should throw infinity but we throw an exception",
+        "description": "test divide by zero",
+        "expectedException": ".*Division by zero.*",
+        "sql": "SELECT doubleCol / 0 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "mod": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "we are returning -0.0 for some reason",
+        "description": "test mod on integer columns",
+        "sql": "SELECT intCol % longCol FROM {numTbl}"
+      },
+      {
+        "description": "test mod on int literal with columns",
+        "sql": "SELECT intCol %  10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should return 0 for 0 value but we are not",
+        "description": "test mod on floating point literal with columns",
+        "sql": "SELECT intCol %  1.2 FROM {numTbl}"
+      },
+      {
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test mod on literals",
+        "sql": "SELECT 3 %  5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "diff due to floating point comparison",

Review Comment:
   can we fix the test framework to compare floating points properly? we can compare within .0001 error bound is probably fine



##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test multiply on integer columns",
+        "sql": "SELECT intCol * longCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on int literal with columns",
+        "sql": "SELECT intCol * 10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on double literal with columns",
+        "sql": "SELECT intCol * 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point",
+        "sql": "SELECT doubleCol * floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point with literal",
+        "sql": "SELECT doubleCol * 2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on zero",
+        "sql": "SELECT doubleCol * 0 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "division": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on integer columns",
+        "sql": "SELECT intCol / longCol FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on int literal with columns",
+        "sql": "SELECT intCol / 10 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on double literal with columns",
+        "sql": "SELECT intCol / 1.2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 5 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point",
+        "sql": "SELECT doubleCol / floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point with literal",
+        "sql": "SELECT doubleCol / 2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should throw infinity but we throw an exception",
+        "description": "test divide by zero",
+        "expectedException": ".*Division by zero.*",
+        "sql": "SELECT doubleCol / 0 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "mod": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "we are returning -0.0 for some reason",
+        "description": "test mod on integer columns",
+        "sql": "SELECT intCol % longCol FROM {numTbl}"
+      },
+      {
+        "description": "test mod on int literal with columns",
+        "sql": "SELECT intCol %  10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should return 0 for 0 value but we are not",
+        "description": "test mod on floating point literal with columns",
+        "sql": "SELECT intCol %  1.2 FROM {numTbl}"
+      },
+      {
+        "comment": "should round on the integer but we return a floating point",

Review Comment:
   I think this comment was accidentally copied



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] walterddr commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
walterddr commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1038292605


##########
pinot-query-runtime/src/test/resources/queries/Comparisons.json:
##########
@@ -390,6 +390,7 @@
     "queries": [
       { "sql": "SELECT val BETWEEN small AND big FROM {tbl}" },
       { "sql": "SELECT val BETWEEN big AND small FROM {tbl}" },
+      { "sql": "SELECT val BETWEEN 2 AND 3 FROM {tbl}" },

Review Comment:
   add `BETWEEN 3 AND 2`
   literal values actually will be optimized out. 



##########
pinot-query-runtime/src/test/resources/queries/Comparisons.json:
##########
@@ -390,6 +390,7 @@
     "queries": [
       { "sql": "SELECT val BETWEEN small AND big FROM {tbl}" },
       { "sql": "SELECT val BETWEEN big AND small FROM {tbl}" },
+      { "sql": "SELECT val BETWEEN 2 AND 3 FROM {tbl}" },

Review Comment:
   add another test for `BETWEEN 3 AND 2`
   literal values actually will be optimized out. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] walterddr commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
walterddr commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1038292605


##########
pinot-query-runtime/src/test/resources/queries/Comparisons.json:
##########
@@ -390,6 +390,7 @@
     "queries": [
       { "sql": "SELECT val BETWEEN small AND big FROM {tbl}" },
       { "sql": "SELECT val BETWEEN big AND small FROM {tbl}" },
+      { "sql": "SELECT val BETWEEN 2 AND 3 FROM {tbl}" },

Review Comment:
   - add another test for `BETWEEN 3 AND 2`; literal values actually will be optimized out. 
   - add NOT BETWEEN variance as well
   - add `3 BETWEEN small AND big` (literal between 2 columns)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] 61yao commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
61yao commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1039048034


##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test multiply on integer columns",
+        "sql": "SELECT intCol * longCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on int literal with columns",
+        "sql": "SELECT intCol * 10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on double literal with columns",
+        "sql": "SELECT intCol * 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point",
+        "sql": "SELECT doubleCol * floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point with literal",
+        "sql": "SELECT doubleCol * 2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on zero",
+        "sql": "SELECT doubleCol * 0 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "division": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on integer columns",
+        "sql": "SELECT intCol / longCol FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on int literal with columns",
+        "sql": "SELECT intCol / 10 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on double literal with columns",
+        "sql": "SELECT intCol / 1.2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 5 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point",
+        "sql": "SELECT doubleCol / floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point with literal",
+        "sql": "SELECT doubleCol / 2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should throw infinity but we throw an exception",
+        "description": "test divide by zero",
+        "expectedException": ".*Division by zero.*",
+        "sql": "SELECT doubleCol / 0 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "mod": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "we are returning -0.0 for some reason",
+        "description": "test mod on integer columns",
+        "sql": "SELECT intCol % longCol FROM {numTbl}"
+      },
+      {
+        "description": "test mod on int literal with columns",
+        "sql": "SELECT intCol %  10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should return 0 for 0 value but we are not",
+        "description": "test mod on floating point literal with columns",
+        "sql": "SELECT intCol %  1.2 FROM {numTbl}"
+      },
+      {
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test mod on literals",
+        "sql": "SELECT 3 %  5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "diff due to floating point comparison",

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] walterddr commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
walterddr commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1038296545


##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [

Review Comment:
   i dont know if we want to test them here, but could we add larger number for mathematic compute overflow?
   e.g. `intCol * 2^30`, `floatCol / 1e-15` etc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] walterddr commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
walterddr commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1038292605


##########
pinot-query-runtime/src/test/resources/queries/Comparisons.json:
##########
@@ -390,6 +390,7 @@
     "queries": [
       { "sql": "SELECT val BETWEEN small AND big FROM {tbl}" },
       { "sql": "SELECT val BETWEEN big AND small FROM {tbl}" },
+      { "sql": "SELECT val BETWEEN 2 AND 3 FROM {tbl}" },

Review Comment:
   - add another test for `BETWEEN 3 AND 2`; literal values actually will be optimized out. 
   - add NOT BETWEEN variance as well



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] walterddr commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
walterddr commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1033909491


##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test multiply on integer columns",
+        "sql": "SELECT intCol * longCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on int literal with columns",
+        "sql": "SELECT intCol * 10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on double literal with columns",
+        "sql": "SELECT intCol * 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point",
+        "sql": "SELECT doubleCol * floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point with literal",
+        "sql": "SELECT doubleCol * 2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on zero",
+        "sql": "SELECT doubleCol * 0 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "division": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on integer columns",
+        "sql": "SELECT intCol / longCol FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on int literal with columns",
+        "sql": "SELECT intCol / 10 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on double literal with columns",
+        "sql": "SELECT intCol / 1.2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 5 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point",
+        "sql": "SELECT doubleCol / floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point with literal",
+        "sql": "SELECT doubleCol / 2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should throw infinity but we throw an exception",
+        "description": "test divide by zero",
+        "expectedException": ".*Division by zero.*",
+        "sql": "SELECT doubleCol / 0 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "mod": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "we are returning -0.0 for some reason",
+        "description": "test mod on integer columns",
+        "sql": "SELECT intCol % longCol FROM {numTbl}"
+      },
+      {
+        "description": "test mod on int literal with columns",
+        "sql": "SELECT intCol %  10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should return 0 for 0 value but we are not",
+        "description": "test mod on floating point literal with columns",
+        "sql": "SELECT intCol %  1.2 FROM {numTbl}"
+      },
+      {
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test mod on literals",
+        "sql": "SELECT 3 %  5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "diff due to floating point comparison",

Review Comment:
   +1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] 61yao commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
61yao commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1039048059


##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test multiply on integer columns",
+        "sql": "SELECT intCol * longCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on int literal with columns",
+        "sql": "SELECT intCol * 10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on double literal with columns",
+        "sql": "SELECT intCol * 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test multiply on literals",
+        "sql": "SELECT 3 * 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point",
+        "sql": "SELECT doubleCol * floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on floating point with literal",
+        "sql": "SELECT doubleCol * 2 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on zero",
+        "sql": "SELECT doubleCol * 0 FROM {numTbl}"
+      },
+      {
+        "description": "test multiply on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "division": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on integer columns",
+        "sql": "SELECT intCol / longCol FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on int literal with columns",
+        "sql": "SELECT intCol / 10 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on double literal with columns",
+        "sql": "SELECT intCol / 1.2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should round on the integer but we return a floating point",
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 5 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on literals",
+        "sql": "SELECT 3 / 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point",
+        "sql": "SELECT doubleCol / floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test divide on floating point with literal",
+        "sql": "SELECT doubleCol / 2 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should throw infinity but we throw an exception",
+        "description": "test divide by zero",
+        "expectedException": ".*Division by zero.*",
+        "sql": "SELECT doubleCol / 0 FROM {numTbl}"
+      },
+      {
+        "description": "test divide on doubleCol with intCol",
+        "sql": "SELECT doubleCol * intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "mod": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 3, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "ignored": true,
+        "comment": "we are returning -0.0 for some reason",
+        "description": "test mod on integer columns",
+        "sql": "SELECT intCol % longCol FROM {numTbl}"
+      },
+      {
+        "description": "test mod on int literal with columns",
+        "sql": "SELECT intCol %  10 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "should return 0 for 0 value but we are not",
+        "description": "test mod on floating point literal with columns",
+        "sql": "SELECT intCol %  1.2 FROM {numTbl}"
+      },
+      {
+        "comment": "should round on the integer but we return a floating point",

Review Comment:
   Removed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] 61yao commented on a diff in pull request #9850: [multistage][testing] Basic math func test and some more between test

Posted by GitBox <gi...@apache.org>.
61yao commented on code in PR #9850:
URL: https://github.com/apache/pinot/pull/9850#discussion_r1039050979


##########
pinot-query-runtime/src/test/resources/queries/MathFuncs.json:
##########
@@ -0,0 +1,439 @@
+{
+  "addition": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test addition on integer columns",
+        "sql": "SELECT intCol + longCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on int literal with columns",
+        "sql": "SELECT intCol + 10 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on double literal with columns",
+        "sql": "SELECT intCol + 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on literals",
+        "sql": "SELECT 3 + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point",
+        "sql": "SELECT doubleCol + floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test addition on floating point with literal",
+        "sql": "SELECT doubleCol + 2 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on zero",
+        "sql": "SELECT doubleCol + 0 FROM {numTbl}"
+      },
+      {
+        "description": "test addition on doubleCol with intCol",
+        "sql": "SELECT doubleCol + intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "subtraction": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [
+          [0, 0, 0.1, 3.2],
+          [123, 321, 4.2, 3.0],
+          [-456, -2, 1.1, 7.7],
+          [123, -456, 3.6, 9.1]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "description": "test subtraction on integer columns",
+        "sql": "SELECT intCol - longCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on int literal with columns",
+        "sql": "SELECT intCol - 10 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on double literal with columns",
+        "sql": "SELECT intCol - 1.2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 5 FROM {numTbl}"
+      },
+      {
+        "ignored": true,
+        "comment": "could be floating comparison issue",
+        "description": "test subtraction on literals",
+        "sql": "SELECT 3 - 2.4 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point",
+        "sql": "SELECT doubleCol - floatCol FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on floating point with literal",
+        "sql": "SELECT doubleCol - 2 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on zero",
+        "sql": "SELECT doubleCol - 0 FROM {numTbl}"
+      },
+      {
+        "description": "test subtraction on doubleCol with intCol",
+        "sql": "SELECT doubleCol - intCol FROM {numTbl}"
+      }
+    ]
+  },
+  "multiply": {
+    "tables": {
+      "numTbl": {
+        "schema": [
+          {"name": "intCol", "type": "INT"},
+          {"name": "longCol", "type": "LONG"},
+          {"name": "doubleCol", "type": "DOUBLE"},
+          {"name": "floatCol", "type": "FLOAT"}
+        ],
+        "inputs": [

Review Comment:
   I thought we are not supporting overflow. Added the test



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org