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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org