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/04 17:03:17 UTC

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

vvysotskyi 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_r299902788
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/metastore/FileSystemMetadataProviderManager.java
 ##########
 @@ -38,6 +41,34 @@ public static MetadataProviderManager init() {
     return new FileSystemMetadataProviderManager();
   }
 
+  /**
+   * Returns {@link TableMetadataProvider} which provides specified schema.
+   *
+   * @param schema table schema which should be provided
+   * @return {@link TableMetadataProvider} which provides specified schema
+   * @throws IOException if exception during {@link TableMetadataProvider} construction happened
+   */
+  public static TableMetadataProvider getMetadataProviderForSchema(TupleMetadata schema) throws IOException {
+    return new FileSystemMetadataProviderManager().builder(MetadataProviderKind.SCHEMA_STATS_ONLY)
+        .withSchema(schema)
+        .build();
+  }
+
+  /**
+   * Checks whether specified {@link MetadataProviderManager} is not null and returns {@link TableMetadataProvider}
+   * obtained from specified {@link MetadataProviderManager}.
+   * Otherwise {@link FileSystemMetadataProviderManager} is used for constructing {@link TableMetadataProvider}.
 
 Review comment:
   Thanks!

----------------------------------------------------------------
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