Sample Header Ad - 728x90

how to insert data into extra columns of target avro table when source table is having less no of columns compared to target using hive or impala?

2 votes
1 answer
1498 views
Suppose I am having a source Avro table having 10 columns and my target Avro table is having 12 columns, while inserting data into the target table I need to add null values to the extra 2 columns. But when I execute the below query it has thrown the exception > AnalysisException: Target table 'target_table' has more columns (8) than the SELECT / VALUES clause returns (7) insert overwrite table target_table select * from source_table; How to make advantage of Avro table automatic schema change detection here? **Note:** Suppose if I want to insert only 5 columns to the target and the rest should be default null. So how to achieve this?
Asked by user109612 (21 rep)
Nov 3, 2016, 09:53 AM
Last activity: May 25, 2021, 08:59 AM