|
| 1 | +-- Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +-- or more contributor license agreements. See the NOTICE file |
| 3 | +-- distributed with this work for additional information |
| 4 | +-- regarding copyright ownership. The ASF licenses this file |
| 5 | +-- to you under the Apache License, Version 2.0 (the |
| 6 | +-- "License"); you may not use this file except in compliance |
| 7 | +-- with the License. You may obtain a copy of the License at |
| 8 | +-- |
| 9 | +-- http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +-- |
| 11 | +-- Unless required by applicable law or agreed to in writing, |
| 12 | +-- software distributed under the License is distributed on an |
| 13 | +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +-- KIND, either express or implied. See the License for the |
| 15 | +-- specific language governing permissions and limitations |
| 16 | +-- under the License. |
| 17 | + |
| 18 | +-- ConfigMatrix: parquet.enable.dictionary=false,true |
| 19 | + |
| 20 | +-- Spark 3.4.3 emits invalid Java for bit_count(boolean). Use interpreted Spark |
| 21 | +-- reference execution; plain queries still assert Comet operator replacement. |
| 22 | +-- Config: spark.sql.codegen.wholeStage=false |
| 23 | +-- Config: spark.sql.codegen.factoryMode=NO_CODEGEN |
| 24 | + |
| 25 | +statement |
| 26 | +CREATE TABLE test_bit_count_types(l bigint, i int, s smallint, b tinyint, flag boolean) USING parquet |
| 27 | + |
| 28 | +statement |
| 29 | +INSERT INTO test_bit_count_types |
| 30 | +SELECT /*+ COALESCE(1) */ l, i, s, b, flag |
| 31 | +FROM VALUES |
| 32 | + (1111, 2222, 17, 7, true), |
| 33 | + (9223372036854775807, 2147483647, 32767, 127, true), |
| 34 | + (-9223372036854775808, -2147483648, -32768, -128, false), |
| 35 | + (-1, -1, -1, -1, false), |
| 36 | + (0, 0, 0, 0, false), |
| 37 | + (1, 1, 1, 1, true), |
| 38 | + (4294967293, 0, 0, 0, true), |
| 39 | + (4294967294, 0, 0, 0, false), |
| 40 | + (4294967295, 0, 0, 0, true), |
| 41 | + (4294967296, 0, 0, 0, false), |
| 42 | + (NULL, NULL, NULL, NULL, NULL) |
| 43 | +AS input(l, i, s, b, flag) |
| 44 | + |
| 45 | +query |
| 46 | +SELECT bit_count(l), bit_count(i), bit_count(s), bit_count(b), bit_count(flag) |
| 47 | +FROM test_bit_count_types |
| 48 | + |
| 49 | +query |
| 50 | +SELECT bit_count(true), bit_count(false) FROM test_bit_count_types |
0 commit comments