[ 
https://issues.apache.org/jira/browse/DRILL-8328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613163#comment-17613163
 ] 

ASF GitHub Bot commented on DRILL-8328:
---------------------------------------

vvysotskyi commented on code in PR #2668:
URL: https://github.com/apache/drill/pull/2668#discussion_r985434252


##########
contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java:
##########
@@ -832,8 +835,36 @@ public static List<String> 
buildParameterList(NullableVarCharHolder[] inputReade
     return inputArguments;
   }
 
-  public static HttpApiConfig getEndpointConfig(String endpoint, 
HttpStoragePluginConfig pluginConfig) {
-    HttpApiConfig endpointConfig = pluginConfig.getConnection(endpoint);
+  /**
+   * This function is used to obtain the configuration information for a given 
API in the HTTP UDF.
+   * If aliasing is enabled, this function will resolve aliases for 
connections.
+   * @param endpoint The name of the endpoint.  Should be a {@link String}
+   * @param context The {@link DrillbitContext} from the current query.
+   * @param info {@link ContextInformation} from the current query.
+   * @param pluginConfig The {@link HttpStoragePluginConfig} the configuration 
from the plugin
+   * @return The {@link HttpApiConfig} corresponding with the endpoint.
+   */
+  public static HttpApiConfig getEndpointConfig(String endpoint,
+                                                DrillbitContext context,
+                                                ContextInformation info,
+                                                HttpStoragePluginConfig 
pluginConfig) {
+    String queryUser = info.getQueryUser();
+    AliasRegistryProvider aliasRegistryProvider = 
context.getAliasRegistryProvider();

Review Comment:
   Good point regarding splitting the logic. I would propose to move it instead 
of UDF to another place, before the `http_request` is evaluated, for example to 
`RexToDrill.getDrillFunctionFromOptiqCall` (or another location), so it could 
have a consistent behavior for regular aliases and aliases for this function 
when query plans contain actual storage name instead of the aliases.





> HTTP UDF Not Resolving Storage Aliases
> --------------------------------------
>
>                 Key: DRILL-8328
>                 URL: https://issues.apache.org/jira/browse/DRILL-8328
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - HTTP
>    Affects Versions: 1.20.0
>            Reporter: Charles Givre
>            Assignee: Charles Givre
>            Priority: Blocker
>             Fix For: 1.20.3
>
>
> The http_request function currently does not resolve plugin aliases 
> correctly.  This PR fixes that issue. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to