Hive 或 Impala 的數據類型與 對應底層的 Parquet schema的數據類型不兼容

背景: 修改了hive表的某些字段的數據類型,如從String  -> Double , 此時,該表所對應的底層文件格式爲Parquet,修改之後,更新Impala索引,然後查詢修改數據類型的字段,會出現與Parquet schema 列數據類型不兼容的問題。


如: Impala —— 

正在提取遇到以下錯誤的結果:

Bad status for request TFetchResultsReq(fetchType=0, operationHandle=TOperationHandle(hasResultSet=True, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='D\x11\x18]\xf7\xa2E*\x8f\x99Ky\x9c\xc8\xda>', guid='D\x11\x18]\xf7\xa2E*\x8f\x99Ky\x9c\xc8\xda>')), orientation=4, maxRows=100): TFetchResultsResp(status=TStatus(errorCode=None, errorMessage="File 'hdfs://xxx:8020/user/hdfs/test/0f399649-1e1d-444b-9d71-24c8db0ac7f3.parquet' has an incompatible Parquet schema for column 'default.test.yyy'. Column type: DOUBLE, Parquet schema:\noptional byte_array QTY [i:30 d:1 r:0]\n", sqlState='HY000', infoMessages=None, statusCode=3), results=None, hasMoreRows=None)


查看其中錯誤信息 : 

 errorMessage="File 'hdfs://xxx:8020/user/hdfs/test/0f399649-1e1d-444b-9d71-24c8db0ac7f3.parquet' has an incompatible Parquet schema for column 'default.test.yyy'. Column type: DOUBLE, Parquet schema:\noptional byte_array QTY [i:30 d:1 r:0]\n"



對應Hive類似,解決方法,參考:

1. http://stackoverflow.com/questions/36085891/hive-doesnt-change-parquet-schema

2. https://issues.cloudera.org/browse/IMPALA-779




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章