[
https://issues.apache.org/jira/browse/HIVE-21388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16787549#comment-16787549
]
Hive QA commented on HIVE-21388:
--------------------------------
Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12961619/HIVE-21388.02.patch
{color:green}SUCCESS:{color} +1 due to 1 test(s) being added or modified.
{color:green}SUCCESS:{color} +1 due to 15820 tests passed
Test results:
https://builds.apache.org/job/PreCommit-HIVE-Build/16399/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/16399/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-16399/
Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.YetusPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
{noformat}
This message is automatically generated.
ATTACHMENT ID: 12961619 - PreCommit-HIVE-Build
> Constant UDF is not pushed to JDBCStorage Handler
> -------------------------------------------------
>
> Key: HIVE-21388
> URL: https://issues.apache.org/jira/browse/HIVE-21388
> Project: Hive
> Issue Type: Improvement
> Components: CBO, StorageHandler
> Affects Versions: 4.0.0
> Reporter: Daniel Dai
> Assignee: Jesus Camacho Rodriguez
> Priority: Major
> Attachments: HIVE-21388.01.patch, HIVE-21388.02.patch,
> HIVE-21388.patch
>
>
> A query involve a Hive UDF which produce a constant value does not push to
> JDBC table. Replacing the UDF with a constant push down works. Ideally, Hive
> shall first do constant folding and then push the computation.
> Here is the example:
> {code}
> explain select PRINCIPAL_NAME from sys.TBL_PRIVS where
> PRINCIPAL_NAME=current_user();
> +----------------------------------------------------+
> | Explain |
> +----------------------------------------------------+
> | Plan optimized by CBO. |
> | |
> | Stage-0 |
> | Fetch Operator |
> | limit:-1 |
> | Select Operator [SEL_3] |
> | Output:["_col0"] |
> | Filter Operator [FIL_2] |
> | predicate:(_col5 = 'hrt_qa') |
> | Select Operator [SEL_1] |
> | Output:["_col5"] |
> | TableScan [TS_0] |
> | Output:["principal_name"],properties:{"hive.sql.query":"SELECT
> `tbl_grant_id`, `create_time`, `grant_option`, `grantor`, `grantor_type`,
> `principal_name`, `principal_type`, `tbl_priv`, `tbl_id`, `authorizer`\nFROM
> `TBL_PRIVS`","hive.sql.query.fieldNames":"tbl_grant_id,create_time,grant_option,grantor,grantor_type,principal_name,principal_type,tbl_priv,tbl_id,authorizer","hive.sql.query.fieldTypes":"bigint,int,int,string,string,string,string,string,bigint,string","hive.sql.query.split":"true"}
> |
> | |
> +----------------------------------------------------+
> {code}
> If I replace current_user() with a constant, the predicate is pushed to table
> scan.
> Also, setting annotation deterministic=true and make initialize() return a
> ConstantObjectInspector of GenericUDFCurrentUser does not make a difference.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)