You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by mehant <gi...@git.apache.org> on 2015/12/01 02:50:34 UTC

[GitHub] drill pull request: DRILL-3938: Support reading from Hive tables t...

Github user mehant commented on a diff in the pull request:

    https://github.com/apache/drill/pull/211#discussion_r46231527
  
    --- Diff: contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/logical/ConvertHiveParquetScanToDrillParquetScan.java ---
    @@ -101,12 +101,24 @@ public boolean matches(RelOptRuleCall call) {
           return true;
         }
     
    +    final List<FieldSchema> tableSchema = hiveTable.getSd().getCols();
         // Make sure all partitions have the same input format as the table input format
         for (HivePartition partition : partitions) {
    -      Class<? extends InputFormat> inputFormat = getInputFormatFromSD(hiveTable, partition.getPartition().getSd());
    +      final StorageDescriptor partitionSD = partition.getPartition().getSd();
    +      Class<? extends InputFormat> inputFormat = getInputFormatFromSD(hiveTable, partitionSD);
           if (inputFormat == null || !inputFormat.equals(tableInputFormat)) {
             return false;
           }
    +
    +      // Make sure the schema of the table and schema of the partition matches. If not return false. Currently native
    --- End diff --
    
    Could you add a minor comment indicating that the schema changes between partition and table can happen due to "alter table" statements and that we would need the converter functions in case the type of the column has been changed via the alter table.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---