<small id='icZnV'></small><noframes id='icZnV'>

    • <bdo id='icZnV'></bdo><ul id='icZnV'></ul>
    <i id='icZnV'><tr id='icZnV'><dt id='icZnV'><q id='icZnV'><span id='icZnV'><b id='icZnV'><form id='icZnV'><ins id='icZnV'></ins><ul id='icZnV'></ul><sub id='icZnV'></sub></form><legend id='icZnV'></legend><bdo id='icZnV'><pre id='icZnV'><center id='icZnV'></center></pre></bdo></b><th id='icZnV'></th></span></q></dt></tr></i><div id='icZnV'><tfoot id='icZnV'></tfoot><dl id='icZnV'><fieldset id='icZnV'></fieldset></dl></div>

    1. <legend id='icZnV'><style id='icZnV'><dir id='icZnV'><q id='icZnV'></q></dir></style></legend>

      1. <tfoot id='icZnV'></tfoot>

        Hive 表在所有查询上返回空结果集

        时间:2024-04-15
        <tfoot id='o2ASj'></tfoot>
        <i id='o2ASj'><tr id='o2ASj'><dt id='o2ASj'><q id='o2ASj'><span id='o2ASj'><b id='o2ASj'><form id='o2ASj'><ins id='o2ASj'></ins><ul id='o2ASj'></ul><sub id='o2ASj'></sub></form><legend id='o2ASj'></legend><bdo id='o2ASj'><pre id='o2ASj'><center id='o2ASj'></center></pre></bdo></b><th id='o2ASj'></th></span></q></dt></tr></i><div id='o2ASj'><tfoot id='o2ASj'></tfoot><dl id='o2ASj'><fieldset id='o2ASj'></fieldset></dl></div>

            <tbody id='o2ASj'></tbody>
            <bdo id='o2ASj'></bdo><ul id='o2ASj'></ul>

            1. <small id='o2ASj'></small><noframes id='o2ASj'>

                <legend id='o2ASj'><style id='o2ASj'><dir id='o2ASj'><q id='o2ASj'></q></dir></style></legend>

                • 本文介绍了Hive 表在所有查询上返回空结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我创建了一个 Hive 表,它从文本文件加载数据.但是它在所有查询上返回空结果集.

                  I created a Hive Table, which loads data from a text file. But its returning empty result set on all queries.

                  我尝试了以下命令:

                  CREATE TABLE table2(
                  id1 INT,
                  id2 INT,
                  id3 INT,
                  id4 STRING,
                  id5 INT,
                  id6 STRING,
                  id7 STRING,
                  id8 STRING,
                  id9 STRING,
                  id10 STRING,
                  id11 STRING,
                  id12 STRING,
                  id13 STRING,
                  id14 STRING,
                  id15 STRING
                  )
                  ROW FORMAT DELIMITED
                  FIELDS TERMINATED BY '|'
                  STORED AS TEXTFILE
                  LOCATION '/user/biadmin/lineitem';
                  

                  命令被执行,表被创建.但是,对于所有查询总是返回 0 行,包括 SELECT * FROM table2;

                  The command gets executed, and the table gets created. But, always returns 0 rows for all queries, including SELECT * FROM table2;

                  示例数据:

                  单行输入数据:

                  1|155190|7706|1|17|21168.23|0.04|0.02|N|O|1996-03-13|1996-02-12|1996-03-22|亲自送货|卡车|上述普通球场|

                  1|155190|7706|1|17|21168.23|0.04|0.02|N|O|1996-03-13|1996-02-12|1996-03-22|DELIVER IN PERSON|TRUCK|egular courts above the|

                  我附上了数据文件的屏幕截图.命令的输出:DESCRIBE FORMATTED table2;

                  I have attached the screen shot of the data file. Output for command: DESCRIBE FORMATTED table2;

                  | Wed Apr 16 20:18:58 IST 2014 : Connection obtained for host: big-instght-15.persistent.co.in, port number 1528. |
                  | # col_name                    data_type                   comment                                               |
                  |                                                                                                                 |
                  | id1                         int                         None                                                    |
                  | id2                         int                         None                                                    |
                  | id3                         int                         None                                                    |
                  | id4                         string                      None                                                    |
                  | id5                         int                         None                                                    |
                  | id6                         string                      None                                                    |
                  | id7                         string                      None                                                    |
                  | id8                         string                      None                                                    |
                  | id9                         string                      None                                                    |
                  | id10                        string                      None                                                    |
                  | id11                        string                      None                                                    |
                  | id12                        string                      None                                                    |
                  | id13                        string                      None                                                    |
                  | id14                        string                      None                                                    |
                  | id15                        string                      None                                                    |
                  |                                                                                                                 |
                  | # Detailed Table Information                                                                                    |
                  | Database:                   default                                                                             |
                  | Owner:                      biadmin                                                                             |
                  | CreateTime:                 Mon Apr 14 20:17:31 IST 2014                                                        |
                  | LastAccessTime:             UNKNOWN                                                                             |
                  | Protect Mode:               None                                                                                |
                  | Retention:                  0                                                                                   |
                  | Location:                   hdfs://big-instght-11.persistent.co.in:9000/user/biadmin/lineitem                 |
                  | Table Type:                 MANAGED_TABLE                                                                       |
                  | Table Parameters:                                                                                               |
                  |         serialization.null.format                                                                               |
                  |         transient_lastDdlTime        1397486851                                                                 |
                  |                                                                                                                 |
                  | # Storage Information                                                                                           |
                  | SerDe Library:              org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe                                  |
                  | InputFormat:                org.apache.hadoop.mapred.TextInputFormat                                            |
                  | OutputFormat:               org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat                          |
                  | Compressed:                 No                                                                                  |
                  | Num Buckets:                -1                                                                                  |
                  | Bucket Columns:             []                                                                                  |
                  | Sort Columns:               []                                                                                  |
                  | Storage Desc Params:                                                                                            |
                  |         field.delim                 |                                                                          |
                  

                  +-----------------------------------------------------------------------------------------------------------------+

                  +-----------------------------------------------------------------------------------------------------------------+

                  谢谢!

                  推荐答案

                  请确保位置 /user/biadmin/lineitem.txt 确实存在并且您在那里有数据.由于您使用的是 LOCATION 子句,因此您的数据必须存在于那里,而不是默认仓库位置 /user/hive/warehouse.

                  Please make sure that the location /user/biadmin/lineitem.txt actually exists and you have data present there. Since you are using LOCATION clause your data must be present there, instead of the default warehouse location, /user/hive/warehouse.

                  快速ls验证:

                  bin/hadoop fs -ls /user/biadmin/lineitem.txt
                  

                  另外,请确保您使用了正确的分隔符.

                  Also, make sure that you are using the proper delimiter.

                  这篇关于Hive 表在所有查询上返回空结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将 BLOB(图像)从 oracle 导入到 hive 下一篇:我们可以将参数传递给 SQL 中的视图吗?

                  相关文章

                      <bdo id='4stf5'></bdo><ul id='4stf5'></ul>
                  1. <tfoot id='4stf5'></tfoot>
                    <legend id='4stf5'><style id='4stf5'><dir id='4stf5'><q id='4stf5'></q></dir></style></legend>

                      <small id='4stf5'></small><noframes id='4stf5'>

                    1. <i id='4stf5'><tr id='4stf5'><dt id='4stf5'><q id='4stf5'><span id='4stf5'><b id='4stf5'><form id='4stf5'><ins id='4stf5'></ins><ul id='4stf5'></ul><sub id='4stf5'></sub></form><legend id='4stf5'></legend><bdo id='4stf5'><pre id='4stf5'><center id='4stf5'></center></pre></bdo></b><th id='4stf5'></th></span></q></dt></tr></i><div id='4stf5'><tfoot id='4stf5'></tfoot><dl id='4stf5'><fieldset id='4stf5'></fieldset></dl></div>