xushiyan commented on code in PR #112: URL: https://github.com/apache/hudi-rs/pull/112#discussion_r1720820708
########## integration_test/tests/hudi_test.rs: ########## @@ -0,0 +1,276 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +use std::{path::Path, sync::Arc}; + +use datafusion::{ + arrow::{ + array::{self, ArrowPrimitiveType, AsArray}, + datatypes::{DataType, Field, Int64Type, Schema, TimeUnit}, + }, + prelude::*, + scalar::ScalarValue, +}; +use hudi::HudiDataSource; +use strum::IntoEnumIterator; +use strum_macros::{AsRefStr, EnumIter, EnumString}; +use url::Url; + +#[derive(PartialEq, Debug)] +struct Record { + id: i32, + name: String, + is_active: bool, +} + +#[derive(Debug, EnumString, EnumIter, AsRefStr, PartialEq)] +#[strum(serialize_all = "snake_case")] +pub enum IntegrationTestTable { + V6ComplexkeygenHivestyle, + V6Empty, + V6Nonpartitioned, + V6SimplekeygenHivestyleNoMetafields, + V6SimplekeygenNonhivestyle, + V6SimplekeygenNonhivestyleOverwritetable, // 1, 21 Review Comment: what does 1, 21 mean? ########## .github/workflows/pr.yml: ########## @@ -18,7 +18,7 @@ name: PR on: - pull_request: + pull_request_target: Review Comment: let's revert this. there is asf policy against using this. we can ignore the labeler issue for now. ########## integration_test/tests/hudi_test.rs: ########## @@ -0,0 +1,276 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +use std::{path::Path, sync::Arc}; + +use datafusion::{ + arrow::{ + array::{self, ArrowPrimitiveType, AsArray}, + datatypes::{DataType, Field, Int64Type, Schema, TimeUnit}, + }, + prelude::*, + scalar::ScalarValue, +}; +use hudi::HudiDataSource; +use strum::IntoEnumIterator; +use strum_macros::{AsRefStr, EnumIter, EnumString}; +use url::Url; + +#[derive(PartialEq, Debug)] +struct Record { + id: i32, + name: String, + is_active: bool, +} + +#[derive(Debug, EnumString, EnumIter, AsRefStr, PartialEq)] +#[strum(serialize_all = "snake_case")] +pub enum IntegrationTestTable { + V6ComplexkeygenHivestyle, + V6Empty, + V6Nonpartitioned, + V6SimplekeygenHivestyleNoMetafields, + V6SimplekeygenNonhivestyle, + V6SimplekeygenNonhivestyleOverwritetable, // 1, 21 + V6TimebasedkeygenNonhivestyle, +} + +impl IntegrationTestTable { + pub fn path(&self) -> String { + let bucket = std::env::var("INTEGRATION_TEST_S3_BUCKET") + .expect("INTEGRATION_TEST_S3_BUCKET not set"); + let data_path = Path::new(format!("s3://{}", bucket).as_str()).join(self.as_ref()); + data_path.to_str().unwrap().to_string() + } + + pub fn url(&self) -> Url { + let path = self.path(); + Url::parse(&path).unwrap() + } +} + +#[test] +fn test_table_path() { Review Comment: in integ test we can leave out this path testing ########## integration_test/tests/hudi_test.rs: ########## @@ -0,0 +1,276 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +use std::{path::Path, sync::Arc}; + +use datafusion::{ + arrow::{ + array::{self, ArrowPrimitiveType, AsArray}, + datatypes::{DataType, Field, Int64Type, Schema, TimeUnit}, + }, + prelude::*, + scalar::ScalarValue, +}; +use hudi::HudiDataSource; +use strum::IntoEnumIterator; +use strum_macros::{AsRefStr, EnumIter, EnumString}; +use url::Url; + +#[derive(PartialEq, Debug)] +struct Record { + id: i32, + name: String, + is_active: bool, +} + +#[derive(Debug, EnumString, EnumIter, AsRefStr, PartialEq)] +#[strum(serialize_all = "snake_case")] +pub enum IntegrationTestTable { Review Comment: can you reuse the code from crates/tests/src/lib.rs:39 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
