You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2019/07/03 10:30:00 UTC

[GitHub] [drill] arina-ielchiieva commented on a change in pull request #1819: DRILL-7313: Use Hive schema for MaprDB native reader when field was empty

arina-ielchiieva commented on a change in pull request #1819: DRILL-7313: Use Hive schema for MaprDB native reader when field was empty
URL: https://github.com/apache/drill/pull/1819#discussion_r299877722
 
 

 ##########
 File path: contrib/storage-hive/core/scrMapr/main/java/org/apache/drill/exec/planner/sql/logical/ConvertHiveMapRDBJsonScanToDrillMapRDBJsonScan.java
 ##########
 @@ -114,23 +123,35 @@ Hive does not always give correct costing (i.e. for external tables Hive does no
   /**
    * Helper method which creates a DrillScanRel with native Drill HiveScan.
    */
-  private DrillScanRel createNativeScanRel(DrillScanRel hiveScanRel, PlannerSettings settings) {
+  private DrillScanRel createNativeScanRel(DrillScanRel hiveScanRel, PlannerSettings settings) throws IOException {
     RelDataTypeFactory typeFactory = hiveScanRel.getCluster().getTypeFactory();
     HiveScan hiveScan = (HiveScan) hiveScanRel.getGroupScan();
-    Map<String, String> parameters = hiveScan.getHiveReadEntry().getHiveTableWrapper().getParameters();
+    HiveReadEntry hiveReadEntry = hiveScan.getHiveReadEntry();
+    Map<String, String> parameters = hiveReadEntry.getHiveTableWrapper().getParameters();
 
     JsonScanSpec scanSpec = new JsonScanSpec(parameters.get(MAPRDB_TABLE_NAME), null, null);
     List<SchemaPath> hiveScanCols = hiveScanRel.getColumns().stream()
         .map(colNameSchemaPath -> replaceOverriddenSchemaPath(parameters, colNameSchemaPath))
         .collect(Collectors.toList());
+
+    HiveToRelDataTypeConverter dataTypeConverter = new HiveToRelDataTypeConverter(typeFactory);
+    TupleSchema schema = new TupleSchema();
+    List<FieldSchema> tableSchemaColumns = hiveReadEntry.getTable().getColumnListsCache().getTableSchemaColumns();
+    tableSchemaColumns.forEach(column ->
 
 Review comment:
   How it will work with lists and maps?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services