mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-03 05:40:40 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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!(
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user