[
https://issues.apache.org/jira/browse/HIVE-24255?focusedWorklogId=499739&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-499739
]
ASF GitHub Bot logged work on HIVE-24255:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Oct/20 23:47
Start Date: 12/Oct/20 23:47
Worklog Time Spent: 10m
Work Description: vineetgarg02 commented on a change in pull request
#1568:
URL: https://github.com/apache/hive/pull/1568#discussion_r503588490
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GlobalLimitOptimizer.java
##########
@@ -99,27 +99,31 @@ public ParseContext transform(ParseContext pctx) throws
SemanticException {
LimitDesc tempGlobalLimitDesc = tempGlobalLimit.getConf();
Table tab = ts.getConf().getTableMetadata();
Set<FilterOperator> filterOps = OperatorUtils.findOperators(ts,
FilterOperator.class);
-
- if (!tab.isPartitioned()) {
- if (filterOps.size() == 0) {
- Integer tempOffset = tempGlobalLimitDesc.getOffset();
- globalLimitCtx.enableOpt(tempGlobalLimitDesc.getLimit(),
- (tempOffset == null) ? 0 : tempOffset);
- }
- } else {
- // check if the pruner only contains partition columns
- if (onlyContainsPartnCols(tab, filterOps)) {
-
- String alias = (String) topOps.keySet().toArray()[0];
- PrunedPartitionList partsList = pctx.getPrunedPartitions(alias,
ts);
-
- // If there is any unknown partition, create a map-reduce job for
- // the filter to prune correctly
- if (!partsList.hasUnknownPartitions()) {
+ // StorageHandlers will always have empty tablePath.
+ // GenMapRedUtils.setMapWork removes empty tablePath from input dir
with select-Limit
+ // InputFormat.getSplits wont be called if no input path & TS Vertex
will have 0 task parallelism
+ if (tab.getStorageHandler() == null) {
Review comment:
Can we move this check to just after getting `TableScanOperator` i.e.
line 94/95? We will avoid un-necessary `checkQBpForGlobalLimit` and
`findOperators`.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 499739)
Time Spent: 20m (was: 10m)
> StorageHandler with select-limit query is returning 0 rows
> ----------------------------------------------------------
>
> Key: HIVE-24255
> URL: https://issues.apache.org/jira/browse/HIVE-24255
> Project: Hive
> Issue Type: Bug
> Reporter: Naresh P R
> Assignee: Naresh P R
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
>
> {code:java}
> CREATE EXTERNAL TABLE dbs(db_id bigint, db_location_uri string, name string,
> owner_name string, owner_type string) STORED BY
> 'org.apache.hive.storage.jdbc.JdbcStorageHandler' TBLPROPERTIES
> ('hive.sql.database.type'='METASTORE', 'hive.sql.query'='SELECT `DB_ID`,
> `DB_LOCATION_URI`, `NAME`, `OWNER_NAME`, `OWNER_TYPE` FROM `DBS`');
> {code}
> ==> Wrong Result <==
> {code:java}
> set hive.limit.optimize.enable=true;
> select * from dbs limit 1;
> ----------------------------------------------------------------------------------------------
> VERTICES MODE STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
> ----------------------------------------------------------------------------------------------
> Map 1 .......... container SUCCEEDED 0 0 0 0 0 0
> ----------------------------------------------------------------------------------------------
> VERTICES: 01/01 [==========================>>] 100% ELAPSED TIME: 0.91 s
> ----------------------------------------------------------------------------------------------
> +------------+----------------------+-----------+-----------------+-----------------+
> | dbs.db_id | dbs.db_location_uri | dbs.name | dbs.owner_name |
> dbs.owner_type |
> +------------+----------------------+-----------+-----------------+-----------------+
> +------------+----------------------+-----------+-----------------+-----------------+
> {code}
> ==> Correct Result <==
> {code:java}
> set hive.limit.optimize.enable=false;
> select * from dbs limit 1;
> ----------------------------------------------------------------------------------------------
> VERTICES MODE STATUS TOTAL COMPLETED RUNNING PENDING
> FAILED KILLED
> ----------------------------------------------------------------------------------------------
> Map 1 .......... container SUCCEEDED 1 1 0 0
> 0 0
> ----------------------------------------------------------------------------------------------
> VERTICES: 01/01 [==========================>>] 100% ELAPSED TIME: 4.11 s
> ----------------------------------------------------------------------------------------------+------------+----------------------------------------------------+-----------+-----------------+-----------------+
> | dbs.db_id | dbs.db_location_uri | dbs.name
> | dbs.owner_name | dbs.owner_type |
> +------------+----------------------------------------------------+-----------+-----------------+-----------------+
> | 1 | hdfs://abcd:8020/warehouse/tablespace/managed/hive | default
> | public | ROLE |
> +------------+----------------------------------------------------+-----------+-----------------+-----------------+{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)