chore: bump arrow, parquet, datafusion and tonic (#1386)

* bump arrow, parquet, datafusion, tonic and greptime-proto

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* add analyzer and fix test

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix clippy warnings

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-04-15 00:03:15 +08:00
committed by GitHub
parent a5771e2ec3
commit a6e41cdd7b
42 changed files with 294 additions and 252 deletions

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::sync::Mutex;
use std::sync::{Arc, Mutex};
use arrow::pyarrow::PyArrowException;
use common_telemetry::{info, timer};
@@ -278,7 +278,7 @@ pub fn try_into_columnar_value(py: Python<'_>, obj: PyObject) -> PyResult<Column
if ret.is_empty() {
return Ok(ColumnarValue::Scalar(ScalarValue::List(
None,
Box::new(new_item_field(ArrowDataType::Null)),
Arc::new(new_item_field(ArrowDataType::Null)),
)));
}
let ty = ret[0].get_datatype();
@@ -291,7 +291,7 @@ pub fn try_into_columnar_value(py: Python<'_>, obj: PyObject) -> PyResult<Column
}
Ok(ColumnarValue::Scalar(ScalarValue::List(
Some(ret),
Box::new(new_item_field(ty)),
Arc::new(new_item_field(ty)),
)))
} else {
to_rust_types!(obj,

View File

@@ -103,7 +103,7 @@ impl PyVector {
}
fn numpy(&self, py: Python<'_>) -> PyResult<PyObject> {
let pa_arrow = self.to_arrow_array().data().to_pyarrow(py)?;
let pa_arrow = self.to_arrow_array().to_data().to_pyarrow(py)?;
let ndarray = pa_arrow.call_method0(py, "to_numpy")?;
Ok(ndarray)
}
@@ -304,7 +304,7 @@ impl PyVector {
}
/// Convert to `pyarrow` 's array
pub(crate) fn to_pyarrow(&self, py: Python) -> PyResult<PyObject> {
self.to_arrow_array().data().to_pyarrow(py)
self.to_arrow_array().to_data().to_pyarrow(py)
}
/// Convert from `pyarrow`'s array
#[classmethod]

View File

@@ -17,6 +17,8 @@
#[cfg(test)]
mod test;
use std::sync::Arc;
use datafusion_common::{DataFusionError, ScalarValue};
use datafusion_expr::ColumnarValue as DFColValue;
use datafusion_physical_expr::AggregateExpr;
@@ -118,7 +120,7 @@ pub fn try_into_columnar_value(obj: PyObjectRef, vm: &VirtualMachine) -> PyResul
// TODO(dennis): empty list, we set type as null.
return Ok(DFColValue::Scalar(ScalarValue::List(
None,
Box::new(new_item_field(ArrowDataType::Null)),
Arc::new(new_item_field(ArrowDataType::Null)),
)));
}
@@ -131,7 +133,7 @@ pub fn try_into_columnar_value(obj: PyObjectRef, vm: &VirtualMachine) -> PyResul
}
Ok(DFColValue::Scalar(ScalarValue::List(
Some(ret),
Box::new(new_item_field(ty)),
Arc::new(new_item_field(ty)),
)))
} else {
Err(vm.new_type_error(format!(

View File

@@ -73,7 +73,7 @@ fn convert_scalar_to_py_obj_and_back() {
ScalarValue::Int64(Some(1)),
ScalarValue::Int64(Some(2)),
]),
Box::new(Field::new("item", ArrowDataType::Int64, false)),
Arc::new(Field::new("item", ArrowDataType::Int64, false)),
));
let to = try_into_py_obj(col, vm).unwrap();
let back = try_into_columnar_value(to, vm).unwrap();