Dandandan commented on code in PR #22250:
URL: https://github.com/apache/datafusion/pull/22250#discussion_r3253033698


##########
datafusion/functions-table/src/generate_series.rs:
##########
@@ -98,7 +98,11 @@ impl SeriesValue for i64 {
     }
 
     fn advance(&mut self, step: &Self::StepType) -> Result<()> {
-        *self += step;
+        *self = self.checked_add(*step).ok_or_else(|| {

Review Comment:
   Interestingly, this is what PostgreSQL returns:
   
   ```
   Output:
   
   119 ms
      generate_series   
   ---------------------
    9223372036854775806
   (1 row)
   
   ```
   
   And DuckDB does the same.
   
   ```
   ┌─────────────────────┐
   │   generate_series   │
   │        int64        │
   ├─────────────────────┤
   │ 9223372036854775806 │
   │ (9.22 quintillion)  │
   └─────────────────────┘
   ```
   
   I think it makes sense to implement the same behavior (i.e. find max value 
during instantiation).



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to