comphead commented on code in PR #8773:
URL: https://github.com/apache/arrow-datafusion/pull/8773#discussion_r1444065858


##########
datafusion/sqllogictest/test_files/expr.slt:
##########
@@ -0,0 +1,1249 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+
+#   http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# test_boolean_expressions
+query BBBB
+SELECT true, false, false = false, true = false
+----
+true false true false
+
+# test_mathematical_expressions_with_null
+query RRRRRRRRRRRRRRRRRR?RRRRRRRIRRRRRRBB
+SELECT
+    sqrt(NULL),
+    cbrt(NULL),
+    sin(NULL),
+    cos(NULL),
+    tan(NULL),
+    asin(NULL),
+    acos(NULL),
+    atan(NULL),
+    sinh(NULL),
+    cosh(NULL),
+    tanh(NULL),
+    asinh(NULL),
+    acosh(NULL),
+    atanh(NULL),
+    floor(NULL),
+    ceil(NULL),
+    round(NULL),
+    trunc(NULL),
+    abs(NULL),
+    signum(NULL),
+    exp(NULL),
+    ln(NULL),
+    log2(NULL),
+    log10(NULL),
+    power(NULL, 2),
+    power(NULL, NULL),
+    power(2, NULL),
+    atan2(NULL, NULL),
+    atan2(1, NULL),
+    atan2(NULL, 1),
+    nanvl(NULL, NULL),
+    nanvl(1, NULL),
+    nanvl(NULL, 1),
+    isnan(NULL),
+    iszero(NULL)
+----
+NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 
NULL NULL NULL NULL
+
+# test_array_cast_invalid_timezone_will_panic
+statement error Parser error: Invalid timezone "Foo": 'Foo' is not a valid 
timezone 
+SELECT arrow_cast('2021-01-02T03:04:00', 'Timestamp(Nanosecond, Some("Foo"))')
+
+# test_array_index
+query III??IIIIII
+SELECT
+    ([5,4,3,2,1])[1],
+    ([5,4,3,2,1])[2],
+    ([5,4,3,2,1])[5],
+    ([[1, 2], [2, 3], [3,4]])[1],
+    ([[1, 2], [2, 3], [3,4]])[3],
+    ([[1, 2], [2, 3], [3,4]])[1][1],
+    ([[1, 2], [2, 3], [3,4]])[2][2],
+    ([[1, 2], [2, 3], [3,4]])[3][2],
+    -- out of bounds
+    ([5,4,3,2,1])[0],
+    ([5,4,3,2,1])[6],
+    -- ([5,4,3,2,1])[-1], -- TODO: wrong answer

Review Comment:
   I have checked with PG
   ```
   select (array[1,2,3,4])[-1]
   null
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to