question

CoreVelocity-6284 avatar image
0 Votes"
CoreVelocity-6284 asked ·

HWC and Hive (HDinsight): reserved keyword as a column name

with an attempt to save the dataframe for a table which has a column name 'timestamp' and SaveMode.Overwrite, the following exception occurs:

org.apache.hadoop.hive.ql.parse.ParseException:line 1:47 cannot recognize input near 'timestamp' 'timestamp' ',' in column name or constraint

Indeed, 'timestamp' is a reserved keyword, however we have the following quote from Hive documentation:

"Reserved keywords are permitted as identifiers if you quote them as described in Supporting Quoted Identifiers in Column Names (version 0.13.0 and later, see HIVE-6013). Most of the keywords are reserved through HIVE-6617 in order to reduce the ambiguity in grammar (version 1.2.0 and later). There are two ways if the user still would like to use those reserved keywords as identifiers: (1) use quoted identifiers, (2) set hive.support.sql11.reserved.keywords=false. (version 2.1.0 and earlier)|"

Any suggestion from community or should it be submitted to support as a bug?

azure-hdinsight
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @CoreVelocity-6284,

Welcome to the Microsoft Q&A platform.

We are reaching out to the internal team to get more help on this, I will update you once we hear back from them.

0 Votes 0 ·

Hello @CoreVelocity-6284,

We are still waiting for an update from internal team. I will get back to you once we hear back from them.

Stay tuned!

0 Votes 0 ·

1 Answer

PRADEEPCHEEKATLA-MSFT avatar image
0 Votes"
PRADEEPCHEEKATLA-MSFT answered ·

Hello @CoreVelocity-6284,

Hive allows reserved keywords in column name if we use backticks around them or just rename the column name.

 `timestamp`

Hope this helps. Do let us know if you any further queries.


Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @CoreVelocity-6284,

Just checking in to see if the above answer helped. If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

0 Votes 0 ·

Hello @CoreVelocity-6284,
Following up to see if the above suggestion was helpful. And, if you have any further query do let us know.
Take care & stay safe!

0 Votes 0 ·