实践hplsql时,遇到的问题总结一下,若有不对的地方,欢迎交流。


一、Hplsql简介

  hplsql的介绍详见:http://lxw1234.com/archives/2015/09/492.htm

二、hpsql的配置文件为hplsql-site.xml

  2.1 常见的选项列表:

hplsql.conn.default 指定默认的连接配置文件,默认值为hive2conn
hplsql.conn.hive2conn  指定HiveServer2JDBC连接
hplsql.conn.init.hive2conn

定义执行SQL语句连接后执行hive2conn 的一些默认设置,如:set system:user.name=mr;

set hive.execution.engine=mr(mr为MapReduce,也可以设置为spark);

hplsql.conn.convert.hive2conn 定义是否对即时SQL转换已启用hive2conn,默认为true
hplsql.conn.mysqlconn     指定MySQL数据库的连接配置文件

  2.2 对hplsql-site.xml配置

编辑hplsql-site.xml

修改或添加以下变量:

<property>

<name>hplsql.conn.default</name>

<value>hive2conn</value>

<description>The default connection profile</description>

</property>

<property>

<name>hplsql.conn.init.hive2conn</name>

<value>set system:user.name=mr;set hive.execution.engine=mr</value>

</property>

<property>

<name>hplsql.conn.hive2conn</name>

<value>org.apache.hive.jdbc.HiveDriver;jdbc:hive2://IPAddress:10000;username;password</value>

<description>HiveServer2 JDBC connection</description>

</property>

三、执行报错

  1)使用hplsql执行HPL/SQL语句,如下:

./hplsql -e "CURRENT_DATE+1"

  正确显示时间;

  2)运行 bin/beeline.sh,然后输入  !connect jdbc:hive2://IPAddress:10000;username;password;

  发现连接成功。

  3)执行的命令:

./hplsql -e "SELECT * FROM default.test LIMIT 10"

  3.1 报错信息:...HiveSQLExpection:Error while compiling statement:No privilege 'Select' found for inputs {.....}

  显示对表没有select权限。

  分析过程:

  1)使用命令vim hplsql脚本发现,该脚本主要是调用hive脚本;

  2)查看hive脚本,发现脚本使用环境变量HIVE_CONF_DIR;

  3)使用命令env|grep hive发现,环境变量HIVE_CONF_DIR未设置;

  4)在/etc/profile中加入export HIVE_CONF_DIR=/etc/hive/conf(根据hplsql-site.xml路径指定)

  3.2 报错信息:java.sql.SQLExpection:Could not open client transport with JDBC Uri:jdbc:hive2://localhost:10000:java.net.ConnetcExpection:拒绝连接

  一般为hive-site.xml文件配置问题

  分析过程:

  1)检查端口10000是否启动

netstat -anp|grep 

  2)检查hive-site.xml配置

<configuration>
<property>
<name>hive.server2.thrift.port</name>
<value>10000</value>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>IPAddress</value>
</property>
</configuration>

注:IPAddress为hive服务对应的IP地址。

Hplsql报错:...HiveSQLExpection:Error while compiling statement:No privilege 'Select' found for inputs {.....}的更多相关文章

  1. HiveSQLException: Error while compiling statement: No privilege 'Create' found for outputs { database:default }

    今天用Hive的JDBC实例时出现了HiveSQLException: Error while compiling statement: No privilege 'Create' found for ...

  2. [ThinkPHP]报错:Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in E:\wamp\www\jdlh\application\index\controller\Index.php on line

    错误提示说命名空间声明语句必须是第一句,可我看就是第一句没毛病呀,这是为啥呢,后面发现<?php 前面有个空格,删掉就正常了 去掉空格之后页面能正常显示

  3. Hive 报错 Error while compiling statement: FAILED: ParseException line 1:0 character '' not supported here (state=42000,code=40000)

    Hive报错 Error while compiling statement: FAILED: ParseException line 1:0 character '' not supported h ...

  4. JS function document.onclick(){}报错Syntax error on token "function", delete this token

    JS function document.onclick(){}报错Syntax error on token "function", delete this token func ...

  5. 一个参数大小写引发的uploadify报错 "Syntax error, unrecognized expression: #"

     上传控件uploadify 报错"Syntax error, unrecognized expression: #" 版本为 uploadify3.2  报错原因:参数ID[hi ...

  6. yum报错:Error: xz compression not available

    测试服务器(centos6.5)经过一段时间的折腾,有一天在上面进行yum操作时突然出现下面的报错: Error: xz compression not available 最后经过一番排查,发现原因 ...

  7. yum报错: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

    在Centos 5.x或6.x上安装RHEL EPEL Repo repository,资源库,源的意思.RHEL EPEL(Extra Packages for Enterprise Linux)  ...

  8. redis报错Windows error 0x70(a large memory)

    redis报错Windows error 0x70 redis 嫌弃你内存不够了,就给你不开第二个实例. The Windows version of Redis allocates a large ...

  9. ASSERT报错:error C2664: “AfxAssertFailedLine”: 不能将参数 1 从“TCHAR []”转换为“LPCSTR”

    转载请注明来源:崨雁嫀筝 http://www.cnblogs.com/xuesongshu 这个错误是我在把tinyxml修改为宽字符(Unicode)版本时候遇到的问题,我首先按关键字把所有有ch ...

随机推荐

  1. Unity扩展编辑器一

    将Test1脚本挂在摄像机上 ​ 如图展示 ​ 下面我们需要在代码中动态的编辑它,请在你的Project视图中创建一个Editor文件夹,把MyEditor放进Editor文件夹中 ​ 在OnInsp ...

  2. linux/Ubuntu系统上安装mysql数据库(附图详解)

    在前面的文章中,我已经分享了如何在Ubuntu系统中安装以及搭建java开发环境,那么当我们需要跟数据打交道的时候,那么就需要在ubuntu系统中安装一个数据库了,那么废话就不多说了,我们这里主要是分 ...

  3. Unity3D — — UGUI之RectTransform

    Mask.GetComponent<RectTransform>().anchoredPosition(子物体) = hotKey_image.rectTransform.anchored ...

  4. ios有些机型input和fixed导致的页面错位问题

    _fixIosInputH () { let [timeout, beforeTop] = [null, 0] $('input, textarea').on('focus', () => { ...

  5. SQLAlchemy并发写入引发的思考

    背景 近期公司项目中加了一个积分机制,用户登录签到会获取登录积分,但会出现一种现象就是用户登录时会增加双倍积分,然后生成两个积分记录.此为问题  问题分析 项目采用微服务架构,下图为积分机制流程   ...

  6. Flink架构分析之Standalone模式启动流程

    概述 FLIP6 对Flink架构进行了改进,引入了Dispatcher组件集成了所有任务共享的一些组件:SubmittedJobGraphStore,LibraryCacheManager等,为了保 ...

  7. Influxdb配置文件详解---influxdb.conf

    官方介绍:https://docs.influxdata.com/influxdb/v1.2/administration/config/ 全局配置 1 2 reporting-disabled =  ...

  8. paste命令详解

    基础命令学习目录首页 原文链接:https://blog.csdn.net/u011341352/article/details/52806312 个人分类: linux   paste命令和cut命 ...

  9. 关于如何使用dubbo管理控制台的一些感想

    1.起因 ​因java项目需要准备安装一个dubbo-admin管理后台研究使用,无奈github上并没有看到dubbo-admin的目录着实让人着急.百度引擎上一些文章也不靠谱!真是浪费时间!所以又 ...

  10. url的param与dict转换

    urllib.parse.urlencode urlencode from urllib import parse from urllib.request import urlopen from ur ...