实践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. 如何推行Code Review

    这篇文章探讨的是如何在一个没有Code Review习惯的团队里面Code Review. 在进行Code Review的时候,审核人很多时候会对被审核人的代码指手画脚,在评价对方的代码,甚至是在批评 ...

  2. vue里extend、mixins、extends的区别

    1.extend Vue.extend使用基础 Vue 构造器,创建一个"子类".参数是一个包含组件选项的对象. // Vue.extend // 创建构造器 var Profil ...

  3. Netty源码分析第8章(高性能工具类FastThreadLocal和Recycler)---->第3节: recycler的使用和创建

    Netty源码分析第八章: 高性能工具类FastThreadLocal和Recycler 第三节: recycler的使用和创建   这一小节开始学习recycler相关的知识, recycler是n ...

  4. 搭建好看的静态博客(使用Hexo进行搭建)

    经常看到大牛的博客非常的高大帅气,虽然我很渣,但是逼格不能输,所以有了以下的搭建记录. 我的成果ninwoo,喜欢的可以参考下面的记录一起来动手搞起来. 安装Git Bash 访问git下载最新版本的 ...

  5. k8s环境搭建--基于minik8s方法

    minik8s 安装 关闭selinux.开启ipv6 sudo bash selinux_ipv6.sh 下载kubectl和minikube 下载minikube,因为国外的源被墙了,所以只能用阿 ...

  6. [朴孝敏][Sketch]

    歌词来源:http://music.163.com/#/song?id=406907303 作曲 : Ryan S. Jhun/August Rigo/Denzil Remedios [作曲 : Ry ...

  7. pstree命令详解

    基础命令学习目录首页 pstree命令是用于查看进程树之间的关系,即哪个进程是父进程,哪个是子进程,可以清楚的看出来是谁创建了谁#pstree几个重要的参数:-A: 各进程树之间的连接以ASCII码字 ...

  8. PHP使用Sublime Text3技巧

    1 下载安装 2 安装Package Control 3 安装插件 4 快捷键 5 项目管理 6 设置代理 PHP开发时,笔者用过EditPlus3.Nodpad++.Vi.Vim和Netbeans, ...

  9. Beta发布 _thunder_文案+美工展示

    作业要求:https://edu.cnblogs.com/campus/nenu/SWE2017FALL/homework/1366 团队介绍:thunder 组成员及各位博客地址: 1.王航:htt ...

  10. 在onResume()中调用getIntent()得不到Extra的问题

    之前 想做activity间的传值,注意 不是 startActivityforResult的那种, 在启动了多层activity再次启动activity想进入到singleTask的MainActi ...