Skip to content

Commit

Permalink
fix ConsistencyCI
Browse files Browse the repository at this point in the history
Signed-off-by: zenghua <[email protected]>
  • Loading branch information
zenghua committed Feb 6, 2024
1 parent a3d6fd0 commit 863399f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public List<String> listTablePathsByNamespace(String tableNamespace) {
return tablePathIdDao.listAllPathByNamespace(tableNamespace);
}

public List<TableInfo> getTableInfosByNamespace(String tableNamespace){
public List<TableInfo> getTableInfosByNamespace(String tableNamespace) {
return tableInfoDao.selectByNamespace(tableNamespace);
}

Expand Down Expand Up @@ -233,7 +233,7 @@ public void deleteSinglePartitionMetaInfo(String tableId, String partitionDesc,
}

private void getSnapshotAndFilePathInfo(String tableId, String partitionDesc, List<DataFileOp> fileOps, List<String> deleteFilePathList,
List<PartitionInfo> filterPartitionInfo, Set<Uuid> snapshotList) {
List<PartitionInfo> filterPartitionInfo, Set<Uuid> snapshotList) {
filterPartitionInfo.forEach(p -> snapshotList.addAll(p.getSnapshotList()));
List<DataCommitInfo> filterDataCommitInfo =
dataCommitInfoDao.selectByTableIdPartitionDescCommitList(tableId, partitionDesc, snapshotList.stream().collect(Collectors.toList()));
Expand Down Expand Up @@ -915,9 +915,6 @@ public void deleteNamespace(String namespace) {
public void cleanMeta() {
if (NativeUtils.NATIVE_METADATA_UPDATE_ENABLED) {
NativeMetadataJavaClient.cleanMeta();
if (!AuthZEnforcer.authZEnabled()) {
namespaceDao.insert(NamespaceDao.DEFAULT_NAMESPACE);
}
return;
}
namespaceDao.clean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,15 @@ object ConsistencyCI {
spark.sql("CREATE NAMESPACE IF NOT EXISTS tpch")
spark.sql("USE tpch")

// load_data(spark)
load_data(spark)

tpchTable.foreach(tup => {
// val sparkDF = spark.sql(s"select * from ${tup._1}")
val sparkDF = spark.sql(s"select * from ${tup._1}")
val rustDF = spark.sql(s"select * from default.${tup._1}")
rustDF.show()
println(s"${tup._1} sparkDF: ")
sparkDF.show
println(s"${tup._1} rustDF: ")
rustDF.show
// val diff1 = sparkDF.rdd.subtract(rustDF.rdd)
// val diff2 = rustDF.rdd.subtract(sparkDF.rdd)
// val result = diff1.count() == 0 && diff2.count() == 0
Expand Down
2 changes: 1 addition & 1 deletion rust/lakesoul-datafusion/src/catalog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) async fn create_table(client: MetaDataClientRef, table_name: &str, co
table_id: format!("table_{}", uuid::Uuid::new_v4()),
table_name: table_name.to_string(),
table_path: format!(
"file://{}default/{}",
"file:{}/default/{}",
env::temp_dir()
.to_str()
.ok_or(LakeSoulError::Internal("can not get $TMPDIR".to_string()))?,
Expand Down
1 change: 1 addition & 0 deletions rust/lakesoul-metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ pub async fn clean_meta_for_test(client: &Client) -> Result<i32> {
let result = client
.batch_execute(
"delete from namespace;
insert into namespace(namespace, properties, comment, domain) values ('default', '{}', '', 'public');
delete from data_commit_info;
delete from table_info;
delete from table_path_id;
Expand Down

0 comments on commit 863399f

Please sign in to comment.