alamb commented on code in PR #5245: URL: https://github.com/apache/arrow-datafusion/pull/5245#discussion_r1103624900
########## datafusion/core/tests/sqllogictests/test_files/scalar.slt: ########## @@ -0,0 +1,63 @@ +# 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. + +############# +## Scalar Tests +############# + +statement ok +CREATE TABLE t1( + a INT, + b INT +) as VALUES + (1, 100), + (2, 1000), + (3, 10000) +; + +# log scalar function +query IT rowsort +select log(2, 64) a, log(100) b union all select log(2, 8), log(10); +---- +3 1 +6 2 + +# log scalar function +query IT rowsort +select log(a, 64) a, log(b), log(10, b) from t1; +---- +3.7855785 4 4 +6 3 3 +Infinity 2 2 + +# log scalar nulls +query IT rowsort +select log(null, 64) a, log(null) b +---- +NULL NULL + +# log scalar nulls 1 +query IT rowsort +select log(2, null) a, log(null) b +---- +NULL NULL + +# log scalar nulls 2 +query IT rowsort +select log(null, null) a, log(null) b +---- Review Comment: Can you please add the test cases you identified in the PR here (log(0), log(1, 64)) as well to document the behavior and also file a ticket to document the discrepancy? ########## datafusion/core/tests/sqllogictests/test_files/scalar.slt: ########## @@ -0,0 +1,63 @@ +# 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. + +############# +## Scalar Tests Review Comment: ```suggestion ## Scalar Function Tests ``` -- 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]
