Skip to content

Conversation

@KnightChess
Copy link
Contributor

@KnightChess KnightChess commented May 17, 2022

Change Logs

after alter table drop partition, will not add schema to Instance.

now, if use delete sql, will get latest instant to get schema, it's ""

before: replacecommit instant extraMetadata

"extraMetadata" : {
    "schema" : ""
  }

after: replacecommit instant extraMetadata

"extraMetadata" : {
    "schema" : "{\"type\":\"record\",\"name\":\"delete_error_test_record\",\"namespace\":\"hoodie.delete_error_test\",\"fields\":[{\"name\":\"_hoodie_commit_time\",\"type\":[\"null\",\"string\"],\"doc\":\"\",\"default\":null},{\"name\":\"_hoodie_commit_seqno\",\"type\":[\"null\",\"string\"],\"doc\":\"\",\"default\":null},{\"name\":\"_hoodie_record_key\",\"type\":[\"null\",\"string\"],\"doc\":\"\",\"default\":null},{\"name\":\"_hoodie_partition_path\",\"type\":[\"null\",\"string\"],\"doc\":\"\",\"default\":null},{\"name\":\"_hoodie_file_name\",\"type\":[\"null\",\"string\"],\"doc\":\"\",\"default\":null},{\"name\":\"id\",\"type\":[\"null\",\"int\"],\"default\":null},{\"name\":\"age\",\"type\":[\"null\",\"int\"],\"default\":null},{\"name\":\"name\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"dt\",\"type\":[\"null\",\"string\"],\"default\":null}]}"
  }

Impact

Fix cannot parse schema when use spark delete sql.

Risk level (write none, low medium or high below)

low

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

Copy link
Contributor

@nsivabalan nsivabalan left a comment

Choose a reason for hiding this comment

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

can we write a test to validate the fix please.

// Create a HoodieWriteClient & issue the delete.
val tableMetaClient = HoodieTableMetaClient.builder
.setConf(sparkContext.hadoopConfiguration).setBasePath(basePath.toString).build()
val schemaStr = new TableSchemaResolver(tableMetaClient).getTableAvroSchema.toString
Copy link
Contributor

Choose a reason for hiding this comment

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

can we also fix L197.

Copy link
Contributor Author

@KnightChess KnightChess Jun 24, 2022

Choose a reason for hiding this comment

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

@nsivabalan
Copy link
Contributor

thanks for the fix!

@nsivabalan nsivabalan added priority:high Significant impact; potential bugs writer-core labels Jun 23, 2022
@nsivabalan nsivabalan added the release-0.12.2 Patches targetted for 0.12.2 label Dec 6, 2022
@codope codope changed the title [HUDI-4113] fix cannot parse <null> schema when use spark delete sql [HUDI-4113] Fix cannot parse <null> schema when use spark delete sql Dec 7, 2022
@codope codope force-pushed the fix-delete-sql-issue branch from 69987db to 5a591f8 Compare December 7, 2022 12:23
Copy link
Member

@codope codope left a comment

Choose a reason for hiding this comment

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

LGTM. We can land once the CI is green.

@hudi-bot
Copy link
Collaborator

hudi-bot commented Dec 7, 2022

CI report:

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

@codope codope merged commit 5faa36f into apache:master Dec 13, 2022
nsivabalan pushed a commit that referenced this pull request Dec 14, 2022
…5610)

- Alter table drop partition will not add schema to instant. 
  If using delete sql, will get latest instant to get schema,
  which is "". This PR fixes the parsing of null or empty schema. 

Co-authored-by: Sagar Sumit <sagarsumit09@gmail.com>
nsivabalan pushed a commit to nsivabalan/hudi that referenced this pull request Mar 22, 2023
…pache#5610)

- Alter table drop partition will not add schema to instant. 
  If using delete sql, will get latest instant to get schema,
  which is "". This PR fixes the parsing of null or empty schema. 

Co-authored-by: Sagar Sumit <sagarsumit09@gmail.com>
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Apr 5, 2023
…pache#5610)

- Alter table drop partition will not add schema to instant. 
  If using delete sql, will get latest instant to get schema,
  which is "". This PR fixes the parsing of null or empty schema. 

Co-authored-by: Sagar Sumit <sagarsumit09@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high Significant impact; potential bugs release-0.12.2 Patches targetted for 0.12.2

Projects

Status: 🚧 Needs Repro
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants