Support Questions
Find answers, ask questions, and share your expertise

can't find row_id

New Contributor
when I run below query in beeline,
select row_id from mydim; 

I got error message "

Error: Error while compiling statement: FAILED: SemanticException [Error 10004]: Line 1:7 Invalid table alias or column reference
de=10004)                                                                                                                        

"

4 REPLIES 4

Re: can't find row_id

Super Guru
@Bill Yang

Make sure you are having row_id column in your table mydim.

Re: can't find row_id

Super Guru

@Bill Yang

No, hive don't have system managed column called row_id but by using window functions(row_number..etc) you can create one column.

In addition hive acid tables will have a hidden column called row__id.You should consider this column a system internal and assume that its name or even its presence may change at any time without warning.

With that out of the way, this column records:

  1. The transactionid that was active when the data was inserted or updated.
  2. The bucketid, the bucket number where the data lives.
  3. The rowid, the rowid within this transaction/bucket combo.
select row__id from hello_acid; //hello_acid is an acid table<br>

Ouptut should look like:

+---------------------------------------------+
|                   row__id                   |
+---------------------------------------------+
| {"transactionid":1,"bucketid":1,"rowid":0}  |
| {"transactionid":3,"bucketid":0,"rowid":0}  |
+---------------------------------------------+<br>

refer to this to know more details about row__id field in acid tables.

some references regarding row_number functions

https://community.hortonworks.com/questions/58405/how-to-get-the-row-number-for-particular-values-fr...

Re: can't find row_id

Super Guru
@Bill Yang

Does the answer helpful to resolve your issue..!!

Take a moment to Log in and Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues and close this thread.

Re: can't find row_id

New Contributor

@Shu,

isn't Row_id system managed column?