Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ object QueryPlanSerde extends Logging with CometExprShim {
classOf[Log2] -> CometLog2,
classOf[Log10] -> CometLog10,
classOf[Multiply] -> CometMultiply,
classOf[Pi] -> CometScalarFunction("pi"),
classOf[Pow] -> CometScalarFunction("pow"),
classOf[Rand] -> CometRand,
classOf[Randn] -> CometRandn,
Expand Down
31 changes: 31 additions & 0 deletions spark/src/test/resources/sql-tests/expressions/math/pi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- 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.

-- ConfigMatrix: parquet.enable.dictionary=false,true

statement
CREATE TABLE test_pi(d double) USING parquet

statement
INSERT INTO test_pi VALUES (1.0)

query tolerance=1e-15
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests with tolerance are not confirming that the queries actually ran in Comet due to a bug that I just discovered. Let's merge #3797 first

SELECT pi() FROM test_pi

-- literal arguments
query tolerance=1e-15
SELECT pi()