pnowojski commented on a change in pull request #6445: [FLINK-8302] [table] Add 
SHIFT_LEFT and SHIFT_RIGHT
URL: https://github.com/apache/flink/pull/6445#discussion_r245662829
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarOperatorsTest.scala
 ##########
 @@ -143,37 +143,94 @@ class ScalarOperatorsTest extends 
ScalarOperatorsTestBase {
     testAllApis(
       3.shiftLeft(-1),
       "3.shiftLeft(-1)",
-      "SHIFTLEFT(3,-1)",
+      "SHIFTLEFT(3, -1)",
       "-2147483648"
     )
 
     testAllApis(
       4.shiftLeft(-1),
       "4.shiftLeft(-1)",
-      "SHIFTLEFT(4,-1)",
+      "SHIFTLEFT(4, -1)",
       "0"
     )
 
     testAllApis(
       5.shiftLeft(-2),
       "5.shiftLeft(-2)",
-      "SHIFTLEFT(5,-2)",
+      "SHIFTLEFT(5, -2)",
       "1073741824"
     )
 
     testAllApis(
       -5.shiftLeft(2),
       "-5.shiftLeft(2)",
-      "SHIFTLEFT(-5,2)",
+      "SHIFTLEFT(-5, 2)",
       "-20"
     )
 
     testAllApis(
       -7.shiftLeft(-1),
       "-7.shiftLeft(-1)",
-      "SHIFTLEFT(-7,-1)",
+      "SHIFTLEFT(-7, -1)",
       "-2147483648"
     )
+
+    //special shift test
+    testAllApis(
+      'f0.shiftLeft(9),
+      "f0.shiftLeft(9)",
+      "SHIFTLEFT(f0, 9)",
+      "0"
+    )
+
+    testAllApis(
+      'f0.shiftLeft(17),
+      "f0.shiftLeft(17)",
+      "SHIFTLEFT(f0, 17)",
+      "0"
 
 Review comment:
   Ops, I made a mistake here. I expected the result here to be `2`, but you 
are right it should be `0`. Can you replace this example with 
`"f0.shiftLeft(33)",`? The expected result should be `2`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to