在直线中使用单元格时,使用简单的select查询,我希望默认返回列名中没有表名的表。
示例
数据
关于简单表https://www.tutorialspoint.com/hive/hive_create_table.htm的示例
CREATE TABLE IF NOT EXISTS employee ( eid int, name String,
salary String, destination String)
COMMENT 'Employee details'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;SELECT查询返回:
SELECT * FROM employee;
+---------------+----------------+------------------+-----------------------+--+
| employee.eid | employee.name | employee.salary | employee.destination |
+---------------+----------------+------------------+-----------------------+--+
+---------------+----------------+------------------+-----------------------+--+期望的结果
通过使用AS实现了所需的结果
SELECT eid AS eid, name AS name, salary AS salary,
destination AS destination FROM employee;
+------+-------+---------+--------------+--+
| eid | name | salary | destination |
+------+-------+---------+--------------+--+
+------+-------+---------+--------------+--+问题
我希望避免在每次运行AS查询时键入select,并作为默认行为返回列名中没有表名的结果。
发布于 2017-03-30 08:54:37
set hive.resultset.use.unique.column.names=false
演示
hive> create table t (i int,j int,k int);
hive> select * from t;t.i t.j t.khive> set hive.resultset.use.unique.column.names=false;
hive> select * from t;i j khttps://stackoverflow.com/questions/43112868
复制相似问题