0

There is an existing hive table data types as below,

col1 String,
col2 String,
col3 String,
col4 String

so when querying with select * from table; it throws below error

Bad status for request TFetchResultsReq(fetchType=0, operationHandle=TOperationHandle(hasResultSet=True, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='\\\x9f\xd0\x97\x88\x98Mg\x82\x85r>\xd9\xf1\xc6\xe1', guid='+M\x99\xb7\xe1\x88C\xea\x9b#\x98\xd59mU\xf8')), orientation=4, maxRows=100): TFetchResultsResp(status=TStatus(errorCode=0, errorMessage='java.io.IOException: java.lang.UnsupportedOperationException: Cannot inspect org.apache.hadoop.io.LongWritable', sqlState=None, infoMessages=['*org.apache.hive.service.cli.HiveSQLException:java.io.IOException: java.lang.UnsupportedOperationException: 

So then I checked the parquet file and their data types as below,

col1 String,
col2 int64,
col3 int64,
col4 int64

then I run ALTER TABLE table CHANGE col2 col2 BIGINT; query for all 3 mismatched columns and changed the column data types. then after query for the data, I'm getting the same error,

then again I have created another hive table as table_test with correct data types as parquet then insert a few files using

LOAD DATA INPATH '/tmp/date=20220109/' 
INTO table table_test PARTITION (date=20220109);

Now all queries become successful.

Is there anyway to fix this issue without inserting all data into new table?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Dulanga Heshan
  • 1,335
  • 1
  • 19
  • 36

0 Answers0