Butao Zhang created HIVE-29296:
----------------------------------

             Summary: Remove getPrimaryKeys codes from beeline module
                 Key: HIVE-29296
                 URL: https://issues.apache.org/jira/browse/HIVE-29296
             Project: Hive
          Issue Type: Bug
    Affects Versions: 4.1.0
            Reporter: Butao Zhang


If you send a select query from Beeline client with --color, you can see 
exception in HS2 logs:
{code:java}
./apache-hive-beeline-4.2.0-SNAPSHOT/bin/beeline -u 
"jdbc:hive2://127.0.0.1:10000/default hive" --color{code}
2025-09-18T16:22:34,121 ERROR [HiveServer2-Handler-Pool: Thread-166] 
thrift.ThriftCLIService: Failed to get primary keys [request: 
TGetPrimaryKeysReq(sessionHandle:TSessionHandle(sessionId:THandleIdentifier(guid:56
 22 37 10 00 2D 4B BB B6 FE 42 49 E2 25 75 1F, secret:C7 E6 BF 96 D1 82 4E F5 
82 36 AC A7 A1 3E 7A A6)), catalogName:, tableName:test12)]
org.apache.hive.service.cli.HiveSQLException: 
org.apache.thrift.protocol.TProtocolException: Required field 'db_name' is 
unset! Struct:PrimaryKeysRequest(db_name:null, tbl_name:test12, catName:hive)
 

As i said in HIVE-29213 
https://issues.apache.org/jira/browse/HIVE-29213?focusedCommentId=18033761&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-18033761
 

 

I believe retrieving the primary key of a table on the beeline side is 
meaningless (the original purpose was only for coloring the beeline output).

{color:#172b4d}We do not need to investigate how to retrieve the correct 
db_name to ensure the method _HiveDatabaseMetaData::getPrimaryKeys(String 
catalog, String schema, String table)_ executes properly. {*}I believe removing 
this code logic would suffice{*}.{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to