[
https://issues.apache.org/jira/browse/HIVE-19256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16527304#comment-16527304
]
Hive QA commented on HIVE-19256:
--------------------------------
Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12920050/HIVE-19256_1.patch
{color:green}SUCCESS:{color} +1 due to 1 test(s) being added or modified.
{color:red}ERROR:{color} -1 due to 1 failed/errored test(s), 14636 tests
executed
*Failed tests:*
{noformat}
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[show_functions]
(batchId=76)
{noformat}
Test results:
https://builds.apache.org/job/PreCommit-HIVE-Build/12238/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/12238/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-12238/
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
Tests exited with: TestsFailedException: 1 tests failed
{noformat}
This message is automatically generated.
ATTACHMENT ID: 12920050 - PreCommit-HIVE-Build
> UDF which shapes the input data according to the specified schema
> -----------------------------------------------------------------
>
> Key: HIVE-19256
> URL: https://issues.apache.org/jira/browse/HIVE-19256
> Project: Hive
> Issue Type: New Feature
> Components: Hive
> Affects Versions: 3.1.0
> Reporter: Ratandeep Ratti
> Assignee: Ratandeep Ratti
> Priority: Major
> Fix For: 3.2.0
>
> Attachments: HIVE-19256.patch, HIVE-19256_1.patch
>
>
> We use this UDF a lot in our org. This UDF takes an object and a Hive schema
> and make sure the output object matches the schema completely. In some
> respects it is similar to {{named
> _struct}} UDF which can be used to select columns from a struct, but it is
> more general since it can work not only on structs, but all Hive data types
> (expect union). Also the schema can provide certain valid type conversions
> (int -> double etc)
> One scenario where this is quite useful is making sure that the Hive view
> created with a specific schema will have columns which will always match that
> schema. In Hive today when a view is created, new nested columns from the
> underlying table can leak out from the view, even though the user never
> wanted this behavior. Note that this leaking of columns is only for nested
> columns and not for top level columns, so in that regard this behavior of
> Hive is inconsistent.
> Sample usage of the UDF
> {code}
> generic_project(col, "struct<a:array<struct<c:int,d:string>>>") // Returning
> data which matches the input schema. Here extra columns which are not part of
> the input will be removed
> generic_project(col, "struct<a:double>") // If the input column had a struct
> with col a as int . It would type cast 'a' to double.
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)