Date is a reserved word in hive, but I have a table with column name 'date'. Every time I do "select date from mytable", it gives me an error.
Is there any way to query this column?
The easiest way to select specific columns in the Hive query is by specifying the column name in the select statement. SELECT col1, col3, col4 .... FROM Table1; But imagine your table contains many columns (i.e : more than 100 columns) and you need to only exclude a few columns in the select statement.
select TBL_NAME, COLUMN_NAME, TYPE_NAME from TBLS left join COLUMNS_V2 on CD_ID = TBL_ID where COLUMN_NAME like 'column'; where 'column' is the column name you're looking for.
(backward apostrophe)date
(backward apostrophe) - works well
SELECT HD1.holidaydate as holiday_date, HD1.hub_id as holiday_hub_id, to_date(HD2.`date`), HD2.dateno as holiday_dateno
FROM table1 HD1 LEFT OUTER JOIN table2 HD2 ON HD1.holidaydate = to_date(HD2.`date`)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With