Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed Sep 19, 2024
1 parent 8d5e660 commit a85f3e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/expr/impl/src/udf/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ use std::sync::{Arc, LazyLock, Weak};
use std::time::Duration;

use anyhow::bail;
use arrow_schema::Fields;
use arrow_udf_flight::Client;
use futures_util::{StreamExt, TryStreamExt};
use ginepro::{LoadBalancedChannel, ResolutionStrategy};
use risingwave_common::array::arrow::{ToArrow, UdfArrowConvert};
use risingwave_common::array::arrow::arrow_schema_udf::{self, Fields};
use risingwave_common::array::arrow::{UdfArrowConvert, UdfToArrow};
use risingwave_common::util::addr::HostAddr;
use thiserror_ext::AsReport;
use tokio::runtime::Runtime;
Expand All @@ -45,15 +45,15 @@ static EXTERNAL: UdfImplDescriptor = UdfImplDescriptor {
};
// A helper function to create a unnamed field from data type.
let to_field = |data_type| convert.to_arrow_field("", data_type);
let args = arrow_schema::Schema::new(
let args = arrow_schema_udf::Schema::new(
opts.arg_types
.iter()
.map(to_field)
.try_collect::<Fields>()?,
);
let returns = arrow_schema::Schema::new(if opts.kind.is_table() {
let returns = arrow_schema_udf::Schema::new(if opts.kind.is_table() {
vec![
arrow_schema::Field::new("row", arrow_schema::DataType::Int32, true),
arrow_schema_udf::Field::new("row", arrow_schema_udf::DataType::Int32, true),
to_field(opts.return_type)?,
]
} else {
Expand Down Expand Up @@ -285,7 +285,7 @@ fn is_tonic_error(err: &arrow_udf_flight::Error) -> bool {
}

/// Check if two list of data types match, ignoring field names.
fn data_types_match(a: &arrow_schema::Schema, b: &arrow_schema::Schema) -> bool {
fn data_types_match(a: &arrow_schema_udf::Schema, b: &arrow_schema_udf::Schema) -> bool {
if a.fields().len() != b.fields().len() {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/expr/impl/src/udf/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use arrow_schema::{DataType, Field};
use arrow_schema_udf::{DataType, Field};
use arrow_udf_python::{CallMode, Runtime};
use futures_util::StreamExt;
use risingwave_common::array::arrow::{ToArrow, UdfArrowConvert};
use risingwave_common::array::arrow::{arrow_schema_udf, UdfArrowConvert, UdfToArrow};

use super::*;

Expand Down

0 comments on commit a85f3e7

Please sign in to comment.