Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In spark SQL/Hive QL, How to select a column that is a reserved keyword

I have a column named 'count' this is easy as flipping to select in LINQ:

rdd.select('count)

but hard to select in SQL, so far all the answer I've found are "illegal name, don't use". How could it be that hard to implement a keyword escaping mechanism?

like image 821
tribbloid Avatar asked Feb 10 '23 14:02

tribbloid


1 Answers

When you wrap the column name in backticks, things might work out. For example:

SELECT date, `last`, open, high, low, volume, change FROM timeseries
like image 113
moorooboorai Avatar answered Feb 13 '23 03:02

moorooboorai