[
https://issues.apache.org/jira/browse/DRILL-7477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17048872#comment-17048872
]
ASF GitHub Bot commented on DRILL-7477:
---------------------------------------
vvysotskyi commented on pull request #2005: DRILL-7477: Allow passing table
function parameters into ANALYZE statement
URL: https://github.com/apache/drill/pull/2005#discussion_r386249100
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java
##########
@@ -721,6 +692,42 @@ private FormatMatcher findMatcher(FileStatus file) {
return null;
}
+ private void setMetadataProviderManager(DrillTable table, String
tableName) {
+ if (table != null) {
+ MetadataProviderManager providerManager = null;
+
+ if (schemaConfig.getOption(ExecConstants.METASTORE_ENABLED).bool_val) {
+ try {
+ MetastoreRegistry metastoreRegistry =
plugin.getContext().getMetastoreRegistry();
+ TableInfo tableInfo = TableInfo.builder()
+ .storagePlugin(plugin.getName())
+ .workspace(schemaName)
+ .name(tableName)
+ .build();
+
+ MetastoreTableInfo metastoreTableInfo = metastoreRegistry.get()
+ .tables()
+ .basicRequests()
+ .metastoreTableInfo(tableInfo);
+ if (metastoreTableInfo.isExists()) {
+ providerManager = new
MetastoreMetadataProviderManager(metastoreRegistry, tableInfo,
+ new
MetastoreMetadataProviderConfig(schemaConfig.getOption(ExecConstants.METASTORE_USE_SCHEMA_METADATA).bool_val,
+
schemaConfig.getOption(ExecConstants.METASTORE_USE_STATISTICS_METADATA).bool_val,
+
schemaConfig.getOption(ExecConstants.METASTORE_FALLBACK_TO_FILE_METADATA).bool_val));
+ }
+ } catch (MetastoreException e) {
+ logger.warn("Exception happened during obtaining Metastore
instance.", e);
Review comment:
Thanks, added more info to the message.
----------------------------------------------------------------
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:
[email protected]
> Allow passing table function parameters into ANALYZE statement
> --------------------------------------------------------------
>
> Key: DRILL-7477
> URL: https://issues.apache.org/jira/browse/DRILL-7477
> Project: Apache Drill
> Issue Type: Sub-task
> Affects Versions: 1.17.0
> Reporter: Vova Vysotskyi
> Assignee: Vova Vysotskyi
> Priority: Major
> Fix For: 1.18.0
>
>
> It would be useful to allow passing table function parameters into ANALYZE
> statement.
> One of the use-cases is to pass the inlined table schema to use it when
> producing ANALYZE.
> Example of the command:
> {code:sql}
> ANALYZE TABLE table(dfs.`table_name` (type => 'parquet',
> autoCorrectCorruptDates => false, enableStringsSignedMinMax=>false,
> schema=>'inline=(mykey int, col_notexist varchar)')) REFRESH METADATA;
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)