[ https://issues.apache.org/jira/browse/HIVE-26046?focusedWorklogId=803973&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-803973 ]
ASF GitHub Bot logged work on HIVE-26046: ----------------------------------------- Author: ASF GitHub Bot Created on: 26/Aug/22 14:48 Start Date: 26/Aug/22 14:48 Worklog Time Spent: 10m Work Description: nrg4878 commented on code in PR #3276: URL: https://github.com/apache/hive/pull/3276#discussion_r956125849 ########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/MySQLConnectorProvider.java: ########## @@ -90,10 +90,20 @@ protected String getDataType(String dbDataType, int size) { // map any db specific types here. switch (dbDataType.toLowerCase()) { + case "bit": + return toHiveBitType(size); default: mappedType = ColumnType.VOID_TYPE_NAME; break; } return mappedType; } + + private String toHiveBitType(int size) { + if (size <= 1) { + return ColumnType.BOOLEAN_TYPE_NAME; + } else { + return ColumnType.BIGINT_TYPE_NAME; Review Comment: @zhangbutao is option #1 above not possible where we set the hive.sql.query to include like a select bin(column_name) ... on the table containing bit type columns? mapping to hive binary type might work. One concern is that doesn't hive expect binary values to be within ''. So something like '0111' instead of 0111. Can you please try it out to see how this works end to end? Issue Time Tracking ------------------- Worklog Id: (was: 803973) Time Spent: 3h 10m (was: 3h) > MySQL's bit datatype is default to void datatype in hive > -------------------------------------------------------- > > Key: HIVE-26046 > URL: https://issues.apache.org/jira/browse/HIVE-26046 > Project: Hive > Issue Type: Sub-task > Components: Standalone Metastore > Affects Versions: 4.0.0 > Reporter: Naveen Gangam > Assignee: zhangbutao > Priority: Major > Labels: pull-request-available > Time Spent: 3h 10m > Remaining Estimate: 0h > > describe on a table that contains a "bit" datatype gets mapped to void. We > need a explicit conversion logic in the MySQL ConnectorProvider to map it to > a suitable datatype in hive. > {noformat} > +-------------------------------+---------------------------------------------------+----------------------------------------------------+ > | col_name | data_type > | comment | > +-------------------------------+---------------------------------------------------+----------------------------------------------------+ > | tbl_id | bigint > | from deserializer | > | create_time | int > | from deserializer | > | db_id | bigint > | from deserializer | > | last_access_time | int > | from deserializer | > | owner | varchar(767) > | from deserializer | > | owner_type | varchar(10) > | from deserializer | > | retention | int > | from deserializer | > | sd_id | bigint > | from deserializer | > | tbl_name | varchar(256) > | from deserializer | > | tbl_type | varchar(128) > | from deserializer | > | view_expanded_text | string > | from deserializer | > | view_original_text | string > | from deserializer | > | is_rewrite_enabled | void > | from deserializer | > | write_id | bigint > | from deserializer > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)