Maintaining the Feature
To upgrade OmniMV, delete all library files, including binary SO files and OmniMV files. Then upload the latest package and install it. Perform the following steps on the management node. Ensure that no task is being executed on the upper-layer engine of OmniMV. Uninstalling the OmniMV software requires deleting the configuration file, binary SO files, and OmniMV files. Perform the following steps only on the management node. You can run the command to query the OmniMV version.
Upgrading OmniMV
- Delete binary SO files and OmniMV files. The installation directory /opt/omnimv is used as an example.
1rm -rf /opt/omnimv
- Download and upload the latest OmniMV installation package to the management node. Then installing OmniMV by following instructions in Installing the Software.
- Optional: After the Spark version is updated, update the materialized view metadata. If the Spark version is not updated, skip this step.
- Delete the materialized view metadata.
- Set the database name.
1DATABASE="tpcds_bin_partitioned_varchar_orc_3000"
- Delete the materialized view metadata.
1 2
hdfs dfs -rm -r -f /omnimv/plugin_metadata/${DATABASE} hdfs dfs -rm -r -f /omnimv/plugin_metadata/mock
- Set the database name.
- Optional: Update the materialized view metadata of Spark 3.1.1 in the database.
- Obtain the command for updating the materialized view metadata.
1 2 3 4
sqls="" mvs=`spark-sql --master local -e "SHOW MATERIALIZED VIEWS" --conf spark.sql.extensions=com.huawei.boostkit.spark.OmniMV --jars /opt/omnimv/boostkit-omnimv-spark-3.1.1-1.2.0-aarch64.jar --database ${DATABASE} | grep -P "^${DATABASE}" |awk -F "\t" '{print $2}' |grep -v "partition"` ; \ for mv in `echo "$mvs"|tr -s '|' ' '`;do sqls="ALTER MATERIALIZED VIEW $mv ENABLE REWRITE;$sqls" ; done echo $sqls|tr -s ';' '\n'
- Run the command.
1spark-sql --master local --database ${DATABASE} --jars /opt/omnimv/boostkit-omnimv-spark-3.1.1-1.2.0-aarch64.jar --conf 'spark.sql.extensions=com.huawei.boostkit.spark.OmniMV' -e "$sqls"
- Obtain the command for updating the materialized view metadata.
- Optional: Update the materialized view metadata of Spark 3.4.3 in the database.
- Obtain the command for updating the materialized view metadata.
1 2 3 4
sqls="" mvs=`spark-sql --master local -e "SHOW MATERIALIZED VIEWS" --conf spark.sql.extensions=com.huawei.boostkit.spark.OmniMV --jars /opt/omnimv/boostkit-omnimv-spark-3.4.3-1.2.0-aarch64.jar --database ${DATABASE} | grep -P "^${DATABASE}" |awk -F "\t" '{print $2}' |grep -v "partition"` ; \ for mv in `echo "$mvs"|tr -s '|' ' '`;do sqls="ALTER MATERIALIZED VIEW $mv ENABLE REWRITE;$sqls" ; done echo $sqls|tr -s ';' '\n'
- Run the command.
1spark-sql --master local --database ${DATABASE} --jars /opt/omnimv/boostkit-omnimv-spark-3.4.3-1.2.0-aarch64.jar --conf 'spark.sql.extensions=com.huawei.boostkit.spark.OmniMV' -e "$sqls"
- Obtain the command for updating the materialized view metadata.
- Delete the materialized view metadata.
Uninstalling OmniMV
- Delete the OmniMV software. The installation directory /opt/omnimv is used as an example.
1rm -rf /opt/omnimv
- Delete the Python environment. The installation directory /opt/anaconda3 is used as an example.
1rm -rf /opt/anaconda3
Querying the Version
You can run the version.txt command to query the OmniMV version.
1 | cat /opt/omnimv/BoostKit-omnimv_1.2.0/version.txt
|
Parent topic: OmniMV