Avoid printing table name in column name when using beeline
When using hive in beeline using a simple query, select
I would like to return the table value without in the default column name.
Example
Data
An example of a simple table (TutorialsPoint) :
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;
The request select
returns:
SELECT * FROM employee;
+---------------+----------------+------------------+-----------------------+--+
| employee.eid | employee.name | employee.salary | employee.destination |
+---------------+----------------+------------------+-----------------------+--+
+---------------+----------------+------------------+-----------------------+--+
Desired results
The desired results are achieved using : AS
SELECT eid AS eid, name AS name, salary AS salary,
destination AS destination FROM employee;
+------+-------+---------+--------------+--+
| eid | name | salary | destination |
+------+-------+---------+--------------+--+
+------+-------+---------+--------------+--+
Problem
I would not want to type every time I run a query and return results without table names in column names as the default behavior. AS
select
+3
source to share