---
title: 在Hadoop安全集群的使用
description: "在安全模式下，针对ORC和Parquet数据集，通过调整SparkExtension插件启动参数可优化性能。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/bds/kunpengbds_omniruntime_20_0143.html
sourcePath: /source/zh/kunpengboostkithistory/2300/bds/kunpengbds_omniruntime_20_0143.html
indexId: a5da275be9fd691676ea3283e949d6e95b78d54a08021307d868ba108836220578
---
# 在Hadoop安全集群的使用

在安全模式下，针对ORC和Parquet数据集，通过调整SparkExtension插件启动参数可优化性能。

- 场景1：安全模式下，数据集的格式为ORC，设置半关闭Native ORC。
  基于执行Spark引擎业务中SparkExtension插件启动命令，添加如下3个参数。 1 --conf spark.sql.codegen.wholeStage=true --conf spark.omni.sql.columnar.nativefilescan=true --conf spark.omni.sql.columnar.orcNativefilescan=false

  半关闭Native ORC是指采用原生ORC读取数据，但是OmniOperator把原生数据结构转化为OmniVector。 3TB数据集的TPCDS 99性能测试结果表明，安全模式下半关闭Native ORC对比非安全模式下Native ORC的平均性能损耗约为10%。

- 场景2：安全模式下，数据集的格式为ORC，设置完全关闭Native ORC，即走原生ORC Table Scan。
  基于执行Spark引擎业务中SparkExtension插件启动命令，添加如下3个参数。 1 --conf spark.sql.codegen.wholeStage=false --conf spark.omni.sql.columnar.nativefilescan=false --conf spark.omni.sql.columnar.orcNativefilescan=false

  3TB数据集的TPCDS 99性能测试结果表明，安全模式下完全关闭Native ORC对比非安全模式下Native ORC的平均性能损耗约为17%。

- 场景3：安全模式下，数据集的格式为Parquet，默认使用Native Parquet。
  基于执行Spark引擎业务中SparkExtension插件启动命令添加如下参数。 1 --conf spark.omni.sql.columnar.nativefilescan=true

  安全模式下Native Parquet对比非安全模式下Native Parquet的平均性能损耗约为5%。
