实践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. 【LeetCode算法题库】Day4:Regular Expression Matching & Container With Most Water & Integer to Roman

    [Q10] Given an input string (s) and a pattern (p), implement regular expression matching with suppor ...

  2. linux下实现压测-html报表生成-控制台参数优化【jmeter】

    jmeter - 单机压测 - 命令行模式-html报表生成-控制台参数优化 一/ 准备工作 1.压力机安装并配置好 jdk 2.调试好程序脚本 再上传到 linux下 3.进入jmeter  bin ...

  3. 木马分析出现python语言,360的安全人员不禁感叹还有这种操作?

    几年前,敲诈者木马还是一个默默无闻的木马种类.然而,由于其极强的破坏力和直接且丰厚的财富回报,敲诈者木马这几年已经一跃成为曝光率最高的木马类型——甚至超越了盗号木马.远控木马.网购木马这传统三强.与此 ...

  4. spring-framework-reference(5.1.1.RELEASE)中文版——Core部分

    前言 最近在学习Spring框架,在学习的同时,借助有道翻译,整理翻译了部分文档,由于尚在学习当中,所以该篇文章将会定时更新,目标在一个月左右时间翻译完全部版本. 虽然大部分内容为翻译,但是其中可能会 ...

  5. jdk8 Optional使用详解

    思考: 调用一个方法得到了返回值却不能直接将返回值作为参数去调用别的方法. 原来解决方案: 我们首先要判断这个返回值是否为null,只有在非空的前提下才能将其作为其他方法的参数.这正是一些类似Guav ...

  6. scrapy笔记集合

    细读http://scrapy-chs.readthedocs.io/zh_CN/latest/index.html 目录 Scrapy介绍 安装 基本命令 项目结构以及爬虫应用介绍 简单使用示例 选 ...

  7. Linux上安装设置mysql 5.7.24

    一,准备 1,先查看Linux是32位还是64位 getconf LONG_BIT 如果返回的是32,那么就是32位 如果返回的是64,那么就是64位 2,如果服务器不能联网,就先去官网下载好压缩包, ...

  8. Notes of Daily Scrum Meeting(11.10)

    Notes of Daily Scrum Meeting(11.10) 今天是周一,虽然仍然在假期里,但是我们仍然要继续我们团队的开发工作了,分工大家已然都很明确,所以接下来 就是认真投入,把自己负责 ...

  9. Notes of Daily Scrum Meeting(11.5)

    Notes of Daily Scrum Meeting(11.5) 今天是我们学习学长代码,同时学习安卓语言的第三天.我们和学长沟通了一下,仔细讨论后得出一个结论,学长在 IOS平台上的代码可以借鉴 ...

  10. Daily Scrum7 11.11

    今日任务: 徐钧鸿:结束了SQL和Affairs的移植,修改了连接池,学习C#和java的正则表达式并且完成相关的移植 张艺:个人阅读作业 黄可嵩:完成高亮显示的移植,进一步移植搜索代码 徐方宇:继续 ...