Skip to content

Conversation

@linrrzqqq
Copy link
Contributor

Versions

  • dev
  • 4.x
  • 3.x
  • 2.1

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built

@linrrzqqq linrrzqqq requested a review from zclllyybb as a code owner December 10, 2025 02:30
zclllyybb pushed a commit to apache/doris that referenced this pull request Jan 7, 2026
… process (#58885)

Related PR: #57569

Problem Summary:

fix the wrong useage of function `default_preprocess_parameter_columns`,
the variable `all_const` should not be affected by manually handled
columns.

### Release note
doc: apache/doris-website#3176

The INTERVAL function uses binary search to return the index of the
first threshold strictly greater than N.

```sql
SELECT INTERVAL(0, 1, 10, 100);
+--------------------------+
| INTERVAL(0, 1, 10, 100)  |
+--------------------------+
|                        0 |
+--------------------------+

SELECT INTERVAL(10, 1, 10, 100, 1000);
+-----------------------------------+
| INTERVAL(10, 1, 10, 100, 1000)   |
+-----------------------------------+
|                                 2 |
+-----------------------------------+

-- First parameter is NULL
SELECT INTERVAL(NULL, 1, 10, 100);
+----------------------------+
| INTERVAL(NULL, 1, 10, 100) |
+----------------------------+
|                         -1 |
+----------------------------+

-- Subsequent parameters are NULL, treated as 0
SELECT INTERVAL(3, -1, NULL, 2, 3, 4);
+--------------------------------+
| INTERVAL(3, -1, NULL, 2, 3, 4) |
+--------------------------------+
|                              4 |
+--------------------------------+
```

Co-authored-by: jianhao <1367919489@qq.com>
github-actions bot pushed a commit to apache/doris that referenced this pull request Jan 7, 2026
… process (#58885)

Related PR: #57569

Problem Summary:

fix the wrong useage of function `default_preprocess_parameter_columns`,
the variable `all_const` should not be affected by manually handled
columns.

### Release note
doc: apache/doris-website#3176

The INTERVAL function uses binary search to return the index of the
first threshold strictly greater than N.

```sql
SELECT INTERVAL(0, 1, 10, 100);
+--------------------------+
| INTERVAL(0, 1, 10, 100)  |
+--------------------------+
|                        0 |
+--------------------------+

SELECT INTERVAL(10, 1, 10, 100, 1000);
+-----------------------------------+
| INTERVAL(10, 1, 10, 100, 1000)   |
+-----------------------------------+
|                                 2 |
+-----------------------------------+

-- First parameter is NULL
SELECT INTERVAL(NULL, 1, 10, 100);
+----------------------------+
| INTERVAL(NULL, 1, 10, 100) |
+----------------------------+
|                         -1 |
+----------------------------+

-- Subsequent parameters are NULL, treated as 0
SELECT INTERVAL(3, -1, NULL, 2, 3, 4);
+--------------------------------+
| INTERVAL(3, -1, NULL, 2, 3, 4) |
+--------------------------------+
|                              4 |
+--------------------------------+
```

Co-authored-by: jianhao <1367919489@qq.com>
@zclllyybb zclllyybb merged commit 35b1c81 into apache:master Jan 7, 2026
1 check passed
@linrrzqqq linrrzqqq deleted the interval branch January 9, 2026 01:49
zzzxl1993 pushed a commit to zzzxl1993/doris that referenced this pull request Jan 13, 2026
… process (apache#58885)

Related PR: apache#57569

Problem Summary:

fix the wrong useage of function `default_preprocess_parameter_columns`,
the variable `all_const` should not be affected by manually handled
columns.

### Release note
doc: apache/doris-website#3176

The INTERVAL function uses binary search to return the index of the
first threshold strictly greater than N.

```sql
SELECT INTERVAL(0, 1, 10, 100);
+--------------------------+
| INTERVAL(0, 1, 10, 100)  |
+--------------------------+
|                        0 |
+--------------------------+

SELECT INTERVAL(10, 1, 10, 100, 1000);
+-----------------------------------+
| INTERVAL(10, 1, 10, 100, 1000)   |
+-----------------------------------+
|                                 2 |
+-----------------------------------+

-- First parameter is NULL
SELECT INTERVAL(NULL, 1, 10, 100);
+----------------------------+
| INTERVAL(NULL, 1, 10, 100) |
+----------------------------+
|                         -1 |
+----------------------------+

-- Subsequent parameters are NULL, treated as 0
SELECT INTERVAL(3, -1, NULL, 2, 3, 4);
+--------------------------------+
| INTERVAL(3, -1, NULL, 2, 3, 4) |
+--------------------------------+
|                              4 |
+--------------------------------+
```

Co-authored-by: jianhao <1367919489@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants