From 267a47e9dde6da6ad34f24eabe69f13806e7fc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E7=A9=BA=E5=A5=BD=E5=83=8F=E4=B8=8B=E9=9B=A8=7E?= <92360611+fariygirl@users.noreply.github.com> Date: Mon, 18 Jul 2022 15:38:30 +0800 Subject: [PATCH] move interp from test to numpy (#88) * move interp from test to numpy * move interp from test to numpy * move interp from test to numpy * move interp from test to numpy * move interp from test to numpy --- Cargo.lock | 2 +- src/common/function/Cargo.toml | 5 +++++ .../tests => common/function/src/scalars/numpy}/interp.rs | 1 + src/common/function/src/scalars/numpy/mod.rs | 2 ++ src/query/Cargo.toml | 1 - src/query/tests/query_engine_test.rs | 1 - 6 files changed, 9 insertions(+), 3 deletions(-) rename src/{query/tests => common/function/src/scalars/numpy}/interp.rs (99%) diff --git a/Cargo.lock b/Cargo.lock index 80fe1d4ba9..73f7915de6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -621,6 +621,7 @@ dependencies = [ name = "common-function" version = "0.1.0" dependencies = [ + "arrow2", "chrono-tz", "common-error", "common-query", @@ -2708,7 +2709,6 @@ dependencies = [ "futures", "futures-util", "metrics", - "num-traits", "snafu", "sql", "table", diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml index 1f83deed1f..3cccfe5b89 100644 --- a/src/common/function/Cargo.toml +++ b/src/common/function/Cargo.toml @@ -4,6 +4,11 @@ version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dependencies.arrow] +package = "arrow2" +version="0.10" +features = ["io_csv", "io_json", "io_parquet", "io_parquet_compression", "io_ipc", "ahash", "compute", "serde_types"] + [dependencies] chrono-tz = "0.6" diff --git a/src/query/tests/interp.rs b/src/common/function/src/scalars/numpy/interp.rs similarity index 99% rename from src/query/tests/interp.rs rename to src/common/function/src/scalars/numpy/interp.rs index d847dad0c1..25a34836bb 100644 --- a/src/query/tests/interp.rs +++ b/src/common/function/src/scalars/numpy/interp.rs @@ -3,6 +3,7 @@ use std::sync::Arc; use arrow::array::PrimitiveArray; use arrow::compute::cast::primitive_to_primitive; use arrow::datatypes::DataType::Float64; +use datatypes::arrow; use datatypes::data_type::DataType; use datatypes::prelude::ScalarVector; use datatypes::type_id::LogicalTypeId; diff --git a/src/common/function/src/scalars/numpy/mod.rs b/src/common/function/src/scalars/numpy/mod.rs index edc754c838..2c648b73b8 100644 --- a/src/common/function/src/scalars/numpy/mod.rs +++ b/src/common/function/src/scalars/numpy/mod.rs @@ -1,4 +1,6 @@ mod clip; +#[allow(unused)] +mod interp; use std::sync::Arc; diff --git a/src/query/Cargo.toml b/src/query/Cargo.toml index 15604c56e4..c9d2d5eb6a 100644 --- a/src/query/Cargo.toml +++ b/src/query/Cargo.toml @@ -21,7 +21,6 @@ datatypes = {path = "../datatypes" } futures = "0.3" futures-util = "0.3" metrics = "0.18" -num-traits = "0.2" snafu = { version = "0.7", features = ["backtraces"] } table = { path = "../table" } tokio = "1.0" diff --git a/src/query/tests/query_engine_test.rs b/src/query/tests/query_engine_test.rs index 18df65610e..3cc3aba478 100644 --- a/src/query/tests/query_engine_test.rs +++ b/src/query/tests/query_engine_test.rs @@ -1,4 +1,3 @@ -mod interp; mod pow; use std::sync::Arc;