[
https://issues.apache.org/jira/browse/HIVE-12785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15091288#comment-15091288
]
Hive QA commented on HIVE-12785:
--------------------------------
Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12781429/HIVE-12785.02.patch
{color:green}SUCCESS:{color} +1 due to 1 test(s) being added or modified.
{color:red}ERROR:{color} -1 due to 14 failed/errored test(s), 10000 tests
executed
*Failed tests:*
{noformat}
TestHWISessionManager - did not produce a TEST-*.xml file
org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver_tez_union
org.apache.hadoop.hive.cli.TestNegativeCliDriver.testNegativeCliDriver_authorization_uri_import
org.apache.hadoop.hive.ql.exec.spark.session.TestSparkSessionManagerImpl.testMultiSessionMultipleUse
org.apache.hadoop.hive.ql.exec.spark.session.TestSparkSessionManagerImpl.testSingleSessionMultipleUse
org.apache.hive.jdbc.TestSSL.testSSLVersion
org.apache.hive.spark.client.TestSparkClient.testAddJarsAndFiles
org.apache.hive.spark.client.TestSparkClient.testCounters
org.apache.hive.spark.client.TestSparkClient.testErrorJob
org.apache.hive.spark.client.TestSparkClient.testJobSubmission
org.apache.hive.spark.client.TestSparkClient.testMetricsCollection
org.apache.hive.spark.client.TestSparkClient.testRemoteClient
org.apache.hive.spark.client.TestSparkClient.testSimpleSparkJob
org.apache.hive.spark.client.TestSparkClient.testSyncRpc
{noformat}
Test results:
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/6581/testReport
Console output:
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/6581/console
Test logs:
http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-6581/
Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 14 tests failed
{noformat}
This message is automatically generated.
ATTACHMENT ID: 12781429 - PreCommit-HIVE-TRUNK-Build
> View with union type and UDF to `cast` the struct is broken
> -----------------------------------------------------------
>
> Key: HIVE-12785
> URL: https://issues.apache.org/jira/browse/HIVE-12785
> Project: Hive
> Issue Type: Bug
> Components: Parser
> Affects Versions: 1.2.1
> Environment: HDP-2.3.4.0
> Reporter: Benoit Perroud
> Assignee: Pengcheng Xiong
> Priority: Minor
> Attachments: HIVE-12785.01.patch, HIVE-12785.02.patch,
> StructFromUnionMinimalB.java, data_minimal.avro
>
>
> Unfortunately HIVE-12156 is breaking the following use case:
> I do have a table with a {{uniontype}} of {{struct}} s, such as:
> {code}
> CREATE TABLE `minimal_sample`(
> `record_type` string,
> `event` uniontype<struct<string_value:string>,struct<int_value:int>>)
> {code}
> In my case, the table comes from an Avro schema which looks like:
> {code}
> 'avro.schema.literal'='{\"type\":\"record\",\"name\":\"Minimal\",\"namespace\":\"org.ver.vkanalas.minimalsamp\",\"fields\":[{\"name\":\"record_type\",\"type\":\"string\"},{\"name\":\"event\",\"type\":[{\"type\":\"record\",\"name\":\"a\",\"fields\":[{\"name\":\"string_value\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"b\",\"fields\":[{\"name\":\"int_value\",\"type\":\"int\"}]}]}]}'
> {code}
> I wrote custom UDF (source attached) to _cast_ the union type to one of the
> struct to access nested elements, such as {{int_value}} in my example.
> {code}
> CREATE FUNCTION toSint AS 'org.ver.udf.minimal.StructFromUnionMinimalB';
> {code}
> A simple query with the UDF is working fine. But creating a view with the
> same select is failing when I'm trying to query it:
> {code}
> CREATE OR REPLACE VIEW minimal_sample_viewB AS SELECT toSint(event).int_value
> FROM minimal_sample WHERE record_type = 'B';
> SELECT * FROM minimal_sample_viewB;
> {code}
> The stack trace is posted below.
> I did try to revert (or exclude) HIVE-12156 from the version I'm running and
> this use case is working fine.
> {code}
> FAILED: SemanticException Line 0:-1 . Operator is only supported on struct or
> list of struct types 'int_value' in definition of VIEW minimal_sample_viewb [
> SELECT null.`int_value` FROM `default`.`minimal_sample` WHERE
> `minimal_sample`.`record_type` = 'B'
> ] used as minimal_sample_viewb at Line 3:14
> 16/01/05 22:49:41 [main]: ERROR ql.Driver: FAILED: SemanticException Line
> 0:-1 . Operator is only supported on struct or list of struct types
> 'int_value' in definition of VIEW minimal_sample_viewb [
> SELECT null.`int_value` FROM `default`.`minimal_sample` WHERE
> `minimal_sample`.`record_type` = 'B'
> ] used as minimal_sample_viewb at Line 3:14
> org.apache.hadoop.hive.ql.parse.SemanticException: Line 0:-1 . Operator is
> only supported on struct or list of struct types 'int_value' in definition of
> VIEW minimal_sample_viewb [
> SELECT null.`int_value` FROM `default`.`minimal_sample` WHERE
> `minimal_sample`.`record_type` = 'B'
> ] used as minimal_sample_viewb at Line 3:14
> at
> org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.getXpathOrFuncExprNodeDesc(TypeCheckProcFactory.java:893)
> at
> org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:1321)
> at
> org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:90)
> at
> org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatchAndReturn(DefaultGraphWalker.java:95)
> at
> org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:79)
> at
> org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(DefaultGraphWalker.java:133)
> at
> org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:110)
> at
> org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:209)
> at
> org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:153)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:10500)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:10455)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genSelectPlan(SemanticAnalyzer.java:3822)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genSelectPlan(SemanticAnalyzer.java:3601)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPostGroupByBodyPlan(SemanticAnalyzer.java:8943)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:8898)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9743)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9623)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9650)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:9636)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genOPTree(SemanticAnalyzer.java:10109)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:329)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10120)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:211)
> at
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:227)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:454)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:314)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1164)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1212)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1101)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1091)
> at
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:216)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:168)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:379)
> at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:314)
> at
> org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:412)
> at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:428)
> at
> org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:717)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:624)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)