Skip to content

Conversation

@YannByron
Copy link
Contributor

@YannByron YannByron commented Jan 13, 2022

To modify SQL statement for creating hudi table based on an existing hudi path.

From:

create table hudi_tbl using hudi tblproperties (primaryKey='id', preCombineField='ts', type='cow') partitioned by (pt) location '/path/to/hudi'

To:

create table hudi_tbl using hudi location '/path/to/hudi'

@YannByron
Copy link
Contributor Author

@hudi-bot run azure

@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Copy link
Member

@xushiyan xushiyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xushiyan xushiyan changed the title [HUDI-3198] optimize create table based on an existing hudi table [HUDI-3198] Improve Spark SQL create table from existing hudi table Jan 14, 2022
@xushiyan xushiyan merged commit 5e0171a into apache:master Jan 14, 2022
@xushiyan xushiyan self-assigned this Jan 14, 2022
@vinishjail97 vinishjail97 mentioned this pull request Jan 24, 2022
5 tasks
vingov pushed a commit to vingov/hudi that referenced this pull request Jan 26, 2022
…pache#4584)

To modify SQL statement for creating hudi table based on an existing hudi path.

From:

```sql
create table hudi_tbl using hudi tblproperties (primaryKey='id', preCombineField='ts', type='cow') partitioned by (pt) location '/path/to/hudi'
```

To:
```sql
create table hudi_tbl using hudi location '/path/to/hudi'
```
liusenhua pushed a commit to liusenhua/hudi that referenced this pull request Mar 1, 2022
…pache#4584)

To modify SQL statement for creating hudi table based on an existing hudi path.

From:

```sql
create table hudi_tbl using hudi tblproperties (primaryKey='id', preCombineField='ts', type='cow') partitioned by (pt) location '/path/to/hudi'
```

To:
```sql
create table hudi_tbl using hudi location '/path/to/hudi'
```
vingov pushed a commit to vingov/hudi that referenced this pull request Apr 3, 2022
…pache#4584)

To modify SQL statement for creating hudi table based on an existing hudi path.

From:

```sql
create table hudi_tbl using hudi tblproperties (primaryKey='id', preCombineField='ts', type='cow') partitioned by (pt) location '/path/to/hudi'
```

To:
```sql
create table hudi_tbl using hudi location '/path/to/hudi'
```
// just persist hoodie.table.create.schema
HoodieTableMetaClient.withPropertyBuilder()
.fromProperties(properties)
.setTableCreateSchema(SchemaConverters.toAvroType(finalSchema).toString())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @YannByron

Recently, we found an Avro schema issue which is caused by the wrong record name (detail here: #7284).

May I ask if this line could cause the same problem? If so, we can discuss how to fix it in PR: #7297

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried, it will rewrite the record name in hoodie.table.create.schema as topLevelRecord in hoodie.properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants