[
https://issues.apache.org/jira/browse/HIVE-24422?focusedWorklogId=516443&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-516443
]
ASF GitHub Bot logged work on HIVE-24422:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Nov/20 02:38
Start Date: 25/Nov/20 02:38
Worklog Time Spent: 10m
Work Description: dengzhhu653 commented on pull request #1702:
URL: https://github.com/apache/hive/pull/1702#issuecomment-733425360
Seems I am wrong. In the trunk, the query
`with game_info as (
select distinct ext_id, dev_app_id, game_name
from game_info_extend )
select count(game_name) from game_info;` , the game_info is firstly
materialized, this can reduce recomputing of game_info no matter how many times
the game_info is referenced later on.
The condition `if (tab == null ||
tab.getDbName().equals(SessionState.get().getCurrentDatabase())) `
in getMetaData will pass as the latter predicate turns out to be true, so the
materialized view is taken other than the table `game_info` for latter use.
@jcamachor, Am I right?
Thanks in advance.
----------------------------------------------------------------
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: 516443)
Time Spent: 20m (was: 10m)
> Throw SemanticException when CTE alias is conflicted with table name
> --------------------------------------------------------------------
>
> Key: HIVE-24422
> URL: https://issues.apache.org/jira/browse/HIVE-24422
> Project: Hive
> Issue Type: Improvement
> Components: Parser
> Reporter: Zhihua Deng
> Assignee: Zhihua Deng
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> If the alias of CTE is conflicted with the table name, we use the alias
> fetching the table other than replacing it with the ASTNode tree, this may
> cause some confusing problems. For example:
> {noformat}
> create table game_info (game_name string);
> with game_info as (
> select distinct ext_id, dev_app_id, game_name
> from game_info_extend )
> select count(game_name) from game_info;{noformat}
> The query will return the number of rows of the table game_info, instead of
> the game_info_extend. Maybe we should better throw an exception to avoid such
> cases.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)