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

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

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

    https://github.com/apache/drill/pull/93#discussion_r35052980
  
    --- Diff: 
common/src/main/java/org/apache/drill/common/config/DrillConfig.java ---
    @@ -138,34 +155,77 @@ public static DrillConfig create(Properties 
testConfigurations) {
         return create(null, testConfigurations, true);
       }
     
    -  public static DrillConfig create(String overrideFileName, boolean 
enableServerConfigs) {
    -    return create(overrideFileName, null, enableServerConfigs);
    +  /**
    +   * ...
    +   * @param overrideFileResourcePathname
    +   *          see {@link #create(String)}'s {@code 
overrideFileResourcePathname}
    +   */
    +  public static DrillConfig create(String overrideFileResourcePathname, 
boolean enableServerConfigs) {
    +    return create(overrideFileResourcePathname, null, enableServerConfigs);
       }
     
    -  private static DrillConfig create(String overrideFileName, Properties 
overriderProps, boolean enableServerConfigs) {
    -    overrideFileName = overrideFileName == null ? 
CommonConstants.CONFIG_OVERRIDE : overrideFileName;
    -
    -    // first we load defaults.
    +  /**
    +   * ...
    +   * @param overrideFileResourcePathname
    +   *          see {@link #create(String)}'s {@code 
overrideFileResourcePathname}
    +   * @param overriderProps
    +   *          optional property map for further overriding (after override 
file
    +   *          is assimilated
    +   * @param enableServerConfigs
    +   *          whether to enable server-specific configuration options
    +   * @return
    +   */
    +  private static DrillConfig create(String overrideFileResourcePathname,
    +                                    final Properties overriderProps,
    +                                    final boolean enableServerConfigs) {
    +    overrideFileResourcePathname =
    +        overrideFileResourcePathname == null
    +            ? CommonConstants.CONFIG_OVERRIDE
    +            : overrideFileResourcePathname;
    +
    +    // 1. Load defaults configuration file.
         Config fallback = null;
         final ClassLoader[] classLoaders = ClasspathHelper.classLoaders();
         for (ClassLoader classLoader : classLoaders) {
    -      if (classLoader.getResource(CommonConstants.CONFIG_DEFAULT) != null) 
{
    -        fallback = ConfigFactory.load(classLoader, 
CommonConstants.CONFIG_DEFAULT);
    +      final URL url =
    +          classLoader.getResource(CommonConstants.CONFIG_DEFAULT);
    +      if (null != url) {
    +        logger.debug("Loading base config. file at {}.", url);
    +        fallback =
    +            ConfigFactory.load(classLoader,
    +                               CommonConstants.CONFIG_DEFAULT);
             break;
           }
         }
     
    +    // 2. Load per-module configuration files.
         Collection<URL> urls = PathScanner.getConfigURLs();
         logger.debug("Loading configs at the following URLs {}", urls);
         for (URL url : urls) {
    +      logger.debug("Loading module config. file at {}.", url);
           fallback = ConfigFactory.parseURL(url).withFallback(fallback);
         }
     
    -    Config effectiveConfig = 
ConfigFactory.load(overrideFileName).withFallback(fallback);
    +    // 3. Load any overrides configuration file and overrides from JVM
    --- End diff --
    
    Reworded a bit.


> Error message must be updated when query fails with FileNotFoundException
> -------------------------------------------------------------------------
>
>                 Key: DRILL-2818
>                 URL: https://issues.apache.org/jira/browse/DRILL-2818
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: SQL Parser
>    Affects Versions: 0.9.0
>         Environment: exception branch
>            Reporter: Abhishek Girish
>            Assignee: Deneche A. Hakim
>            Priority: Minor
>              Labels: error_message_must_fix
>             Fix For: 1.3.0
>
>
> When user specifies a non-existent file/directory in a query, the following 
> error is being thrown:
> {code:sql}
> > show files from dfs.tmp.`tpch`;
> Query failed: SYSTEM ERROR: Failure handling SQL.
> [9184097e-8339-42d3-96ce-1fba51c6bc78 on 192.168.158.107:31010]
> Error: exception while executing query: Failure while executing query. 
> (state=,code=0)
> {code}
> This should be updated to 
> {code:sql}
> > show files from dfs.tmp.`tpch`;
> Query failed: File /tmp/tpch does not exist. 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to