
# spark-beeline查询Hive视图报错
#### 用户问题
MRS 3.1.2版本，spark-beeline查询Hive视图报错，报错如下：
![](https://support.huaweicloud.com/trouble-mrs/zh-cn_image_0000001431275589.png "点击放大")
根据提示set spark.sql.hive.manageFilesourcePartitions=false后，查不到数据（但是实际在Hive查询中是有数据的）。
![](https://support.huaweicloud.com/trouble-mrs/zh-cn_image_0000001431137937.png "点击放大")
#### 原因分析
转换格式失败，spark-sql使用其内置的Metastore，而不是Hive中使用的Metastore，所以读取元数据时失败，spark-sql内部读取的是Partque格式的数据，而Hive中默认是ORC的。
#### 处理步骤
1. 登录Spark客户端节点，执行如下命令，进入spark-sql： 
   **cd** *{客户端安装目录}*
   **source bigdata_env**
   **source Spark2x/component_env**
   **kinit** *组件业务用户*（普通模式无需执行kinit）
   **spark-sql**
   
   
2. 执行如下命令设置spark.sql.hive.convertMetastoreOrc=false。 
   **set spark.sql.hive.convertMetastoreOrc=false;**
   
   
3. 重新查询Hive视图，显示正常。 
   ![](https://support.huaweicloud.com/trouble-mrs/zh-cn_image_0000001532395453.png "点击放大")
   
   
 
