alamb commented on code in PR #10275:
URL: https://github.com/apache/datafusion/pull/10275#discussion_r1583596812


##########
datafusion/sqllogictest/test_files/array.slt:
##########
@@ -5666,15 +5677,25 @@ select generate_series(5),
 [0, 1, 2, 3, 4, 5] [2, 3, 4, 5] [2, 5, 8] [1, 2, 3, 4, 5] [5, 4, 3, 2, 1] [10, 
7, 4] [1992-09-01, 1992-10-01, 1992-11-01, 1992-12-01, 1993-01-01, 1993-02-01, 
1993-03-01] [1993-02-01, 1993-01-31, 1993-01-30, 1993-01-29, 1993-01-28, 
1993-01-27, 1993-01-26, 1993-01-25, 1993-01-24, 1993-01-23, 1993-01-22, 
1993-01-21, 1993-01-20, 1993-01-19, 1993-01-18, 1993-01-17, 1993-01-16, 
1993-01-15, 1993-01-14, 1993-01-13, 1993-01-12, 1993-01-11, 1993-01-10, 
1993-01-09, 1993-01-08, 1993-01-07, 1993-01-06, 1993-01-05, 1993-01-04, 
1993-01-03, 1993-01-02, 1993-01-01] [1989-04-01, 1990-04-01, 1991-04-01, 
1992-04-01]
 
 ## should throw error

Review Comment:
   ```suggestion
   ## should return NULL
   ```



##########
datafusion/sqllogictest/test_files/array.slt:
##########
@@ -5632,14 +5632,25 @@ select range(NULL)
 NULL
 
 ## should throw error

Review Comment:
   ```suggestion
   ## should return NULL
   ```



##########
datafusion/functions-array/src/udf.rs:
##########
@@ -166,146 +166,6 @@ impl ScalarUDFImpl for StringToArray {
     }
 }
 
-make_udf_function!(

Review Comment:
   is this just an accidental left over copy?



##########
datafusion/functions-array/src/udf.rs:
##########
@@ -166,146 +166,6 @@ impl ScalarUDFImpl for StringToArray {
     }
 }
 
-make_udf_function!(
-    Range,
-    range,
-    start stop step,
-    "create a list of values in the range between start and stop",
-    range_udf
-);
-#[derive(Debug)]
-pub struct Range {
-    signature: Signature,
-    aliases: Vec<String>,
-}
-impl Range {
-    pub fn new() -> Self {
-        use DataType::*;
-        Self {
-            signature: Signature::one_of(
-                vec![
-                    TypeSignature::Exact(vec![Int64]),
-                    TypeSignature::Exact(vec![Int64, Int64]),
-                    TypeSignature::Exact(vec![Int64, Int64, Int64]),
-                    TypeSignature::Exact(vec![Date32, Date32, 
Interval(MonthDayNano)]),
-                ],
-                Volatility::Immutable,
-            ),
-            aliases: vec![String::from("range")],
-        }
-    }
-}
-impl ScalarUDFImpl for Range {
-    fn as_any(&self) -> &dyn Any {
-        self
-    }
-    fn name(&self) -> &str {
-        "range"
-    }
-
-    fn signature(&self) -> &Signature {
-        &self.signature
-    }
-
-    fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
-        use DataType::*;
-        Ok(List(Arc::new(Field::new(
-            "item",
-            arg_types[0].clone(),
-            true,
-        ))))
-    }
-
-    fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
-        let args = ColumnarValue::values_to_arrays(args)?;
-        match args[0].data_type() {
-            arrow::datatypes::DataType::Int64 => {
-                crate::kernels::gen_range(&args, 
false).map(ColumnarValue::Array)
-            }
-            arrow::datatypes::DataType::Date32 => {
-                crate::kernels::gen_range_date(&args, 
false).map(ColumnarValue::Array)
-            }
-            _ => {
-                exec_err!("unsupported type for range")
-            }
-        }
-    }
-
-    fn aliases(&self) -> &[String] {
-        &self.aliases
-    }
-}
-
-make_udf_function!(

Review Comment:
   Likewise this looks like an accidental copy too -- here is the other copy:
   
   
https://github.com/apache/datafusion/blob/0ea9bc659cbcdd1d70cf8ea8c284634d65171c33/datafusion/functions-array/src/range.rs#L102-L163



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