Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
datafusion 0.1.2 - Docs.rs
[go: Go Back, main page]

datafusion 0.1.2

DataFusion is a datasource-agnostic distributed query processing framework for Rust inspired by Apache Spark
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::super::api::*;
use super::super::rel::*;

pub struct SqrtFunction {
}

impl ScalarFunction for SqrtFunction {
    fn execute(&self, args: Vec<Value>) -> Result<Value,Box<String>> {
        match args[0] {
            Value::Double(d) => Ok(Value::Double(d.sqrt())),
            Value::UnsignedLong(l) => Ok(Value::Double((l as f64).sqrt())),
            _ => Err(Box::new("Unsupported arg type for sqrt".to_string()))
        }
    }
}