You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/08/02 06:19:00 UTC
[jira] [Commented] (HUDI-2232) [SQL] MERGE INTO fails with table
having nested struct
[ https://issues.apache.org/jira/browse/HUDI-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17391353#comment-17391353 ]
ASF GitHub Bot commented on HUDI-2232:
--------------------------------------
pengzhiwei2018 opened a new pull request #3379:
URL: https://github.com/apache/hudi/pull/3379
## What is the purpose of the pull request
Fix the bug that merge into fails when table having nested struct type
## Brief change log
*(for example:)*
- *Modify AnnotationLocation checkstyle rule in checkstyle.xml*
## Verify this pull request
*(Please pick either of the following options)*
This pull request is a trivial rework / code cleanup without any test coverage.
*(or)*
This pull request is already covered by existing tests, such as *(please describe tests)*.
(or)
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end.*
- *Added HoodieClientWriteTest to verify the change.*
- *Manually verified the change by running a job locally.*
## Committer checklist
- [ ] Has a corresponding JIRA in PR title & commit
- [ ] Commit message is descriptive of the change
- [ ] CI is green
- [ ] Necessary doc changes done or have another open PR
- [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
> [SQL] MERGE INTO fails with table having nested struct
> ------------------------------------------------------
>
> Key: HUDI-2232
> URL: https://issues.apache.org/jira/browse/HUDI-2232
> Project: Apache Hudi
> Issue Type: Sub-task
> Reporter: Sagar Sumit
> Assignee: pengzhiwei
> Priority: Blocker
> Labels: release-blocker
> Fix For: 0.9.0
>
>
> {code:java}
> // TO reproduce
> drop table if exists hudi_gh_ext_fixed;
> create table hudi_gh_ext_fixed ( id int, name string, price double, ts long, repo struct<id:bigint,name:string>) using hudi options(primaryKey = 'id', precombineField = 'ts') location 'file:///tmp/hudi-h5-fixed';
> insert into hudi_gh_ext_fixed values(3, 'AMZN', 300, 120, struct(234273476,"onnet/onnet-portal"));
> insert into hudi_gh_ext_fixed values(2, 'UBER', 300, 120, struct(234273476,"onnet/onnet-portal"));
> insert into hudi_gh_ext_fixed values(4, 'GOOG', 300, 120, struct(234273476,"onnet/onnet-portal"));
> update hudi_gh_ext_fixed set price = 150.0 where name = 'UBER';
> drop table if exists hudi_fixed;
> create table hudi_fixed ( id int, name string, price double, ts long, repo struct<id:bigint,name:string>) using hudi options(primaryKey = 'id', precombineField = 'ts') partitioned by (ts) location 'file:///tmp/hudi-h5-part-fixed';
> insert into hudi_fixed values(2, 'UBER', 200, struct(234273476,"onnet/onnet-portal"), 130);
> select * from hudi_gh_ext_fixed;
> 20210727145240 20210727145240_0_6442266 id:3 77fc2e3e-add9-4f08-a5e1-9671d66add26-0_0-1472-72063_20210727145240.parquet 3 AMZN 300.0 120 {"id":234273476,"name":"onnet/onnet-portal"}20210727145301 20210727145301_0_6442269 id:2 77fc2e3e-add9-4f08-a5e1-9671d66add26-0_0-1565-77094_20210727145301.parquet 2 UBER 150.0 120 {"id":234273476,"name":"onnet/onnet-portal"}20210727145254 20210727145254_0_6442268 id:4 77fc2e3e-add9-4f08-a5e1-9671d66add26-0_0-1534-75283_20210727145254.parquet 4 GOOG 300.0 120 {"id":234273476,"name":"onnet/onnet-portal"}
> select * from hudi_fixed;
> 20210727145325 20210727145325_0_6442270 id:2 ts=130 ba148271-68b4-40aa-816a-158170446e41-0_0-1595-78703_20210727145325.parquet 2 UBER 200.0 {"id":234273476,"name":"onnet/onnet-portal"} 130
> MERGE INTO hudi_fixed USING (select id, name, price, repo, ts from hudi_gh_ext_fixed) updatesON hudi_fixed.id = updates.idWHEN MATCHED THEN UPDATE SET *WHEN NOT MATCHED THEN INSERT *;
> -- java.lang.IllegalArgumentException: UnSupport StructType yet-- at org.apache.spark.sql.hudi.command.payload.SqlTypedRecord.convert(SqlTypedRecord.scala:122)-- at org.apache.spark.sql.hudi.command.payload.SqlTypedRecord.get(SqlTypedRecord.scala:56)-- at org.apache.hudi.sql.payload.ExpressionPayloadEvaluator_b695b02a_99b5_479e_8299_507da9b206fd.eval(Unknown Source)-- at org.apache.spark.sql.hudi.command.payload.ExpressionPayload$AvroTypeConvertEvaluator.eval(ExpressionPayload.scala:333)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)