[ 
https://issues.apache.org/jira/browse/IMPALA-5903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zoltán Borók-Nagy resolved IMPALA-5903.
---------------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 3.0

> Inconsistent specification of result set and result set metadata
> ----------------------------------------------------------------
>
>                 Key: IMPALA-5903
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5903
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Catalog, Frontend
>    Affects Versions: Impala 2.10.0
>            Reporter: Lars Volker
>            Assignee: Zoltán Borók-Nagy
>            Priority: Critical
>              Labels: incompatibility
>             Fix For: Impala 3.0
>
>
> Some statements that return a result set declare it in Frontend.java, but 
> other do not. Still the queries seem to work. We should take a closer look at 
> how/where the result set metadata is specified and returned to the user, and 
> ideally, make the paths today consistent (or provide a good explanation for 
> the inconsistency).
> For example, compute stats does return a result set, but we never declare it 
> as returning a result set.
> You can easily test the behavior of GetResultMetadata() by modifying one of 
> our tests under tests/hs2/
> Take a look at Frontend.java and search for COMPUTE_STATS. You will see that 
> we incorrectly declare the result set to be empty.
> From {{fe/src/main/java/org/apache/impala/service/Frontend.java}} at 
> {{f8e7c31}}:
> {noformat}
>  403     } else if (analysis.isComputeStatsStmt()) {
>  404       ddl.op_type = TCatalogOpType.DDL;
>  405       TDdlExecRequest req = new TDdlExecRequest();
>  406       req.setDdl_type(TDdlType.COMPUTE_STATS);
>  407       
> req.setCompute_stats_params(analysis.getComputeStatsStmt().toThrift());
>  408       ddl.setDdl_params(req);
>  409       metadata.setColumns(Collections.<TColumn>emptyList());
>  410     }
> {noformat}
> L409 shows an empty list for the result set metadata.
> However in 
> {{fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java}} we 
> construct a result set:
> {noformat}
>  472         case UPDATE_STATS:
>  473           Preconditions.checkState(params.isSetUpdate_stats_params());
>  474           Reference<Long> numUpdatedColumns = new Reference<>(0L);
>  475           alterTableUpdateStats(tbl, params.getUpdate_stats_params(), 
> response,
>  476               numUpdatedPartitions, numUpdatedColumns);
>  477           reloadTableSchema = true;
>  478           resultColVal.setString_val("Updated " + 
> numUpdatedPartitions.getRef() +
>  479               " partition(s) and " + numUpdatedColumns.getRef() + " 
> column(s).");
>  480           setResultSet = true;
>  481           break;
> {noformat}
> This has the potential to break HS2 clients that expect a result set when 
> computing stats. But in practice, compute stats works and returns a result 
> set, so the current code/flow is confusing.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to