Skip to content

Commit

Permalink
remove data-quality module
Browse files Browse the repository at this point in the history
  • Loading branch information
SbloodyS committed Nov 15, 2024
1 parent e0d9360 commit 508a489
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 944 deletions.
8 changes: 8 additions & 0 deletions docs/docs/en/guide/upgrade/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ Execution result:
- Migrate lineage data to new table `t_ds_workflow_task_lineage`.
- This script only performs upsert operations, not deletes. You can delete it manually if you need to.

### Drop Data-Quality Related Table

Execute script: `sh ./tools/bin/drop-table.sh`.

Execution result:

- This script only performs `drop table` operations.

### Upgrade Service

- If you deploy with Pseudo-Cluster deployment, change it according to [Pseudo-Cluster](../installation/pseudo-cluster.md) section "Modify Configuration".
Expand Down
8 changes: 8 additions & 0 deletions docs/docs/zh/guide/upgrade/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ jar 包 并添加到 `./tools/libs` 目录下,设置以下环境变量
- 原血缘数据迁移至新血缘表 `t_ds_workflow_task_lineage`
- 此脚本仅执行 upsert 操作,不执行删除操作,如果需要删除,您可以手动删除。

### 删除数据质量相关表

执行脚本:`sh ./tools/bin/drop-table.sh`

执行结果:

- 此脚本仅执行 `drop table` 操作。

### 服务升级

#### 修改配置内容
Expand Down
316 changes: 0 additions & 316 deletions dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql

Large diffs are not rendered by default.

317 changes: 0 additions & 317 deletions dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql

Large diffs are not rendered by default.

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions dolphinscheduler-tools/src/main/bin/drop-table.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
#
# 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.
#

BIN_DIR=$(dirname $0)
DOLPHINSCHEDULER_HOME=${DOLPHINSCHEDULER_HOME:-$(cd ${BIN_DIR}/../..;pwd)}
TOOLS_HOME=$(cd ${BIN_DIR}/..;pwd)

if [ "$DOCKER" != "true" ]; then
source "$DOLPHINSCHEDULER_HOME/bin/env/dolphinscheduler_env.sh"
fi

JAVA_OPTS=${JAVA_OPTS:-"-server -Duser.timezone=${SPRING_JACKSON_TIME_ZONE} -Xms4g -Xmx4g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof"}

$JAVA_HOME/bin/java $JAVA_OPTS \
-cp "$TOOLS_HOME/conf":"$TOOLS_HOME/sql":"$TOOLS_HOME/libs/*" \
-Dspring.profiles.active=dropTable,${DATABASE} \
org.apache.dolphinscheduler.tools.table.DropTable
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* 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.
*/

package org.apache.dolphinscheduler.tools.table;

import java.sql.SQLException;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

@SpringBootApplication
@ComponentScan("org.apache.dolphinscheduler")
@Slf4j
public class DropTable {

public static void main(String[] args) {
SpringApplication.run(DropTable.class, args);
}

@Component
@Profile("dropTable")
static class DropTableRunner implements CommandLineRunner {

@Autowired
private DropTableService dropTableService;

@Override
public void run(String... args) throws SQLException {
log.info("Starting Drop Table...");
dropTableService.dropTableOnce();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* 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.
*/

package org.apache.dolphinscheduler.tools.table;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.ArrayList;
import java.util.List;

import javax.sql.DataSource;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class DropTableService {

@Autowired
private DataSource dataSource;

public void dropTableOnce() {
List<String> dropTableDDLList = getDropTableDDL();

for (String dropTableDDL : dropTableDDLList) {
try {
try (Connection connection = dataSource.getConnection()) {
try (PreparedStatement pstmt = connection.prepareStatement(dropTableDDL)) {
pstmt.executeUpdate();
}
}
} catch (Exception e) {
log.error("Failed to execute sql: {},", dropTableDDL, e);
}
}
}

private List<String> getDropTableDDL() {
List<String> dropTableDDLList = new ArrayList<>();
dropTableDDLList.add("DROP TABLE IF EXISTS t_ds_dq_comparison_type;");
dropTableDDLList.add("DROP TABLE IF EXISTS t_ds_dq_rule_execute_sql;");
dropTableDDLList.add("DROP TABLE IF EXISTS t_ds_dq_rule_input_entry;");
dropTableDDLList.add("DROP TABLE IF EXISTS t_ds_dq_task_statistics_value;");
return dropTableDDLList;
}

}

0 comments on commit 508a489

Please sign in to comment.