zoukankan      html  css  js  c++  java
  • Hive 中的分号问题

    1.  hive表中有一列值,是以 分号 ; 为分隔符连接存储的

    1470047164;1470047628;1470049068;1470048978;1470048922;1470047658;1470047628;1470047628;1470047778;

    2. 使用sql语句在HUE里面直接以 ; 分隔查询并无异常。

    select 
         test.thedate
        ,time_stamp1 
    from
    (
      select 
         thedate
        ,time_stamp 
      from my_table
      where dt='2016-08-10'
    )test
    lateral view explode(split(time_stamp,';')) t as time_stamp1
    limit 10;

    3. 但是,在把脚本保存后,oozie自动化执行时却报很奇怪的错误:

    Error: Error while compiling statement: FAILED: ParseException line 23:39 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in select expression (state=42000,code=40000)

    4. 搜索了一下,发现问题的根源竟然是分号!!

    分号是 SQL的结束符,在HDFS里识别并不智能,HQL直接识别为  EOF.

    解决方法: 用分号的二进制 073来代替即可。

    select 
         test.thedate
        ,time_stamp1 
    from
    (
      select 
         thedate
        ,time_stamp 
      from my_table
      where dt='2016-08-10'
    )test
    lateral view explode(split(time_stamp,'73')) t as time_stamp1
    limit 10;
  • 相关阅读:
    爬虫 xpath
    Mongo 基础命令
    大数据 Spark 连接外部资源
    大数据 Spark 异常
    大数据 Spark 安装
    python 对象克隆
    一个Vue表单提交防抖的实用例子
    一个防抖和节流的实用例子
    前端面试100问(1-10)
    每日技术:encodeURI,encodeURIComponent,toFixed
  • 原文地址:https://www.cnblogs.com/skyEva/p/5800503.html
Copyright © 2011-2022 走看看