|
| 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 | +-- With allowIncompatible unset, MakeInterval uses Spark's JVM codegen dispatcher. |
| 19 | + |
| 20 | +statement |
| 21 | +CREATE TABLE test_make_interval_dispatch( |
| 22 | + years int, |
| 23 | + months int, |
| 24 | + weeks int, |
| 25 | + days int, |
| 26 | + hours int, |
| 27 | + mins int, |
| 28 | + secs decimal(18, 6)) USING parquet |
| 29 | + |
| 30 | +statement |
| 31 | +INSERT INTO test_make_interval_dispatch VALUES |
| 32 | + (1, 2, 3, 4, 5, 6, 7.123456), |
| 33 | + (0, 1, 0, 1, 0, 0, 100.000001), |
| 34 | + (-1, -2, -1, -1, -1, -1, -1.500000), |
| 35 | + (NULL, 1, 2, 3, 4, 5, 6.000000), |
| 36 | + (2, NULL, 2, 3, 4, 5, 6.000000), |
| 37 | + (3, 1, 2, 3, 4, 5, NULL), |
| 38 | + (0, 0, 0, 0, 2562048, 0, 0.000000) |
| 39 | + |
| 40 | +query |
| 41 | +SELECT make_interval(years, months, weeks, days, hours, mins, secs) |
| 42 | +FROM test_make_interval_dispatch |
| 43 | +WHERE hours != 2562048 |
| 44 | +ORDER BY years |
| 45 | + |
| 46 | +query ignore(https://github.com/apache/datafusion-comet/issues/5279) |
| 47 | +SELECT make_interval(0, 0, 0, 0, hours) |
| 48 | +FROM test_make_interval_dispatch |
| 49 | +WHERE hours = 2562048 |
0 commit comments