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
use super::super::api::*;
use super::super::rel::*;

/// create a latitude/longitude value from two doubles
pub struct LatLngFunc {
}

impl ScalarFunction for LatLngFunc {
    fn execute(&self, args: Vec<Value>) -> Result<Value,Box<String>> {
        if args.len() != 2 {
            return Err(Box::new("Wrong argument count for LatLngFunc".to_string()))
        }
        match (&args[0], &args[1]) {
            (&Value::Double(lat), &Value::Double(lng)) => Ok(Value::ComplexValue(
                vec![Value::Double(lat), Value::Double(lng)])),
            _ => Err(Box::new("Unsupported type for LatLngFunc".to_string()))
        }
    }
}