Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl PyExecutionContext {
// generate a random (unique) name for this table
// table name cannot start with numeric digit
let name = "c".to_owned()
+ &Uuid::new_v4()
+ Uuid::new_v4()
.to_simple()
.encode_lower(&mut Uuid::encode_buffer());

Expand Down
8 changes: 4 additions & 4 deletions src/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ impl PyNumberProtocol for PyExpr {
}

fn __mod__(lhs: PyExpr, rhs: PyExpr) -> PyResult<PyExpr> {
Ok(lhs.expr.clone().modulus(rhs.expr).into())
Ok(lhs.expr.modulus(rhs.expr).into())
}

fn __and__(lhs: PyExpr, rhs: PyExpr) -> PyResult<PyExpr> {
Ok(lhs.expr.clone().and(rhs.expr).into())
Ok(lhs.expr.and(rhs.expr).into())
}

fn __or__(lhs: PyExpr, rhs: PyExpr) -> PyResult<PyExpr> {
Ok(lhs.expr.clone().or(rhs.expr).into())
Ok(lhs.expr.or(rhs.expr).into())
}

fn __invert__(&self) -> PyResult<PyExpr> {
Expand Down Expand Up @@ -140,7 +140,7 @@ impl PyMappingProtocol for PyExpr {
fn __getitem__(&self, key: &str) -> PyResult<PyExpr> {
Ok(Expr::GetIndexedField {
expr: Box::new(self.expr.clone()),
key: ScalarValue::Utf8(Some(key.to_string()).to_owned()),
key: ScalarValue::Utf8(Some(key.to_string())),
}
.into())
}
Expand Down
6 changes: 2 additions & 4 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,11 @@ fn window(
expr: datafusion::logical_plan::Expr::WindowFunction {
fun,
args: args.into_iter().map(|x| x.expr).collect::<Vec<_>>(),
partition_by: partition_by
.unwrap_or(vec![])
partition_by: partition_by.unwrap_or_default()
.into_iter()
.map(|x| x.expr)
.collect::<Vec<_>>(),
order_by: order_by
.unwrap_or(vec![])
order_by: order_by.unwrap_or_default()
.into_iter()
.map(|x| x.expr)
.collect::<Vec<_>>(),
Expand Down
2 changes: 1 addition & 1 deletion src/udaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl PyAggregateUDF {
volatility: &str,
) -> PyResult<Self> {
let function = logical_plan::create_udaf(
&name,
name,
input_type,
Arc::new(return_type),
parse_volatility(volatility)?,
Expand Down