@@ -555,25 +555,26 @@ private[hive] class HiveMetastoreCatalog(val client: ClientInterface, hive: Hive
555555
556556 plan transformUp {
557557 // Write path
558- case InsertIntoTable (relation : MetastoreRelation , _, _, _, _ )
558+ case i @ InsertIntoTable (r : MetastoreRelation , partition, child, overwrite, ifNotExists )
559559 // Inserting into partitioned table is not supported in Parquet data source (yet).
560- if ! relation .hiveQlTable.isPartitioned &&
561- hive.convertMetastoreParquet &&
562- relation.tableDesc.getSerdeClassName.toLowerCase.contains( " parquet " ) =>
563- convertToParquetRelation(relation )
560+ if ! r .hiveQlTable.isPartitioned && hive.convertMetastoreParquet &&
561+ r.tableDesc.getSerdeClassName.toLowerCase.contains( " parquet " ) =>
562+ val parquetRelation = convertToParquetRelation(r)
563+ InsertIntoTable (parquetRelation, partition, child, overwrite, ifNotExists )
564564
565565 // Write path
566- case InsertIntoHiveTable (relation : MetastoreRelation , _, _, _, _ )
566+ case i @ InsertIntoHiveTable (r : MetastoreRelation , partition, child, overwrite, ifNotExists )
567567 // Inserting into partitioned table is not supported in Parquet data source (yet).
568- if ! relation .hiveQlTable.isPartitioned &&
569- hive.convertMetastoreParquet &&
570- relation.tableDesc.getSerdeClassName.toLowerCase.contains( " parquet " ) =>
571- convertToParquetRelation(relation )
568+ if ! r .hiveQlTable.isPartitioned && hive.convertMetastoreParquet &&
569+ r.tableDesc.getSerdeClassName.toLowerCase.contains( " parquet " ) =>
570+ val parquetRelation = convertToParquetRelation(r)
571+ InsertIntoTable (parquetRelation, partition, child, overwrite, ifNotExists )
572572
573573 // Read path
574574 case relation : MetastoreRelation if hive.convertMetastoreParquet &&
575575 relation.tableDesc.getSerdeClassName.toLowerCase.contains(" parquet" ) =>
576- convertToParquetRelation(relation)
576+ val parquetRelation = convertToParquetRelation(relation)
577+ Subquery (relation.alias.getOrElse(relation.tableName), parquetRelation)
577578 }
578579 }
579580 }
0 commit comments