You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "codope (via GitHub)" <gi...@apache.org> on 2024/07/18 17:22:26 UTC
[PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
codope opened a new pull request, #11650:
URL: https://github.com/apache/hudi/pull/11650
### Change Logs
Without throwing error, table gets created with incorrect partitions if values are inserted in the same order as create table schema.
### Impact
Usability
### 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. If not, put "none"._
- _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](https://hudi.apache.org/contribute/developer-setup#website) to make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2237341711
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4551f0a1afb4409b4b67ad504e7d81843256c01c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2237203884
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4551f0a1afb4409b4b67ad504e7d81843256c01c Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2247798610
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
}, {
"hash" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943",
"triggerID" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"triggerType" : "PUSH"
}, {
"hash" : "9a45d6040a51beb000162721c7e2fc09cd147535",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24975",
"triggerID" : "9a45d6040a51beb000162721c7e2fc09cd147535",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 9a45d6040a51beb000162721c7e2fc09cd147535 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24975)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "codope (via GitHub)" <gi...@apache.org>.
codope merged PR #11650:
URL: https://github.com/apache/hudi/pull/11650
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2242274018
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 21fea17b816877dd6ef876818400de776e8056ae Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2247580921
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
}, {
"hash" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943",
"triggerID" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"triggerType" : "PUSH"
}, {
"hash" : "9a45d6040a51beb000162721c7e2fc09cd147535",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24975",
"triggerID" : "9a45d6040a51beb000162721c7e2fc09cd147535",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 1828dc1d8e4e274ecf24b6514638dcfca2f65010 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943)
* 9a45d6040a51beb000162721c7e2fc09cd147535 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24975)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2242628501
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
}, {
"hash" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 21fea17b816877dd6ef876818400de776e8056ae Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942)
* 1828dc1d8e4e274ecf24b6514638dcfca2f65010 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2247562661
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
}, {
"hash" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943",
"triggerID" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"triggerType" : "PUSH"
}, {
"hash" : "9a45d6040a51beb000162721c7e2fc09cd147535",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "9a45d6040a51beb000162721c7e2fc09cd147535",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 1828dc1d8e4e274ecf24b6514638dcfca2f65010 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943)
* 9a45d6040a51beb000162721c7e2fc09cd147535 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2242194095
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4551f0a1afb4409b4b67ad504e7d81843256c01c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903)
* 21fea17b816877dd6ef876818400de776e8056ae UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #11650:
URL: https://github.com/apache/hudi/pull/11650#discussion_r1689159522
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSchemaUtils.scala:
##########
@@ -244,4 +245,24 @@ object HoodieSchemaUtils {
(newSchema, isSchemaCompatible(tableSchema, newSchema))
}
}
+
+ /**
+ * Check if the partition schema fields order matches the table schema fields order.
+ *
+ * @param tableSchema The table schema
+ * @param partitionFields The partition fields
+ */
+ def checkPartitionSchemaOrder(tableSchema: StructType, partitionFields: Seq[String]): Unit = {
+ val tableSchemaFields = tableSchema.fields.map(_.name)
+ // It is not allowed to specify partition columns when the table schema is not defined.
+ // https://spark.apache.org/docs/latest/sql-error-conditions.html#specify_partition_is_not_allowed
+ if (tableSchemaFields.isEmpty && partitionFields.nonEmpty) {
+ throw new IllegalArgumentException("It is not allowed to specify partition columns when the table schema is not defined.")
+ }
+ // Filter the table schema fields to get the partition field names in order
+ val tableSchemaPartitionFields = tableSchemaFields.filter(partitionFields.contains).toSeq
+ if (tableSchemaPartitionFields != partitionFields) {
+ throw new IllegalArgumentException("Partition schema fields order does not match the table schema fields order.")
Review Comment:
It's great if we also print these two schemas in the log.
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2242642986
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
}, {
"hash" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943",
"triggerID" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 21fea17b816877dd6ef876818400de776e8056ae Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942)
* 1828dc1d8e4e274ecf24b6514638dcfca2f65010 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "KnightChess (via GitHub)" <gi...@apache.org>.
KnightChess commented on code in PR #11650:
URL: https://github.com/apache/hudi/pull/11650#discussion_r1685468692
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieAnalysis.scala:
##########
@@ -428,6 +428,12 @@ case class ResolveImplementationsEarly() extends Rule[LogicalPlan] {
if sparkAdapter.isHoodieTable(table) && ct.query.forall(_.resolved) =>
CreateHoodieTableAsSelectCommand(table, mode, query)
+ case ct: CreateTable =>
+ // NOTE: In case of CreateTable with schema and multiple partition fields,
+ // we have to make sure that partition fields are ordered in the same way as they are in the schema.
+ HoodieSchemaUtils.checkPartitionSchemaOrder(ct.tableDesc.schema, ct.tableDesc.partitionColumnNames)
Review Comment:
like `df.saveAsTable` or `create table as select`, the tableDesc will not have schema, may be need use query logical plan output
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "codope (via GitHub)" <gi...@apache.org>.
codope commented on code in PR #11650:
URL: https://github.com/apache/hudi/pull/11650#discussion_r1686011329
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieAnalysis.scala:
##########
@@ -428,6 +428,12 @@ case class ResolveImplementationsEarly() extends Rule[LogicalPlan] {
if sparkAdapter.isHoodieTable(table) && ct.query.forall(_.resolved) =>
CreateHoodieTableAsSelectCommand(table, mode, query)
+ case ct: CreateTable =>
+ // NOTE: In case of CreateTable with schema and multiple partition fields,
+ // we have to make sure that partition fields are ordered in the same way as they are in the schema.
+ HoodieSchemaUtils.checkPartitionSchemaOrder(ct.tableDesc.schema, ct.tableDesc.partitionColumnNames)
Review Comment:
CTAS is handled in the case above but good point about `df.saveAsTable`. Will fix it.
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2237187484
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4551f0a1afb4409b4b67ad504e7d81843256c01c UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "codope (via GitHub)" <gi...@apache.org>.
codope commented on code in PR #11650:
URL: https://github.com/apache/hudi/pull/11650#discussion_r1686310744
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieAnalysis.scala:
##########
@@ -428,6 +428,12 @@ case class ResolveImplementationsEarly() extends Rule[LogicalPlan] {
if sparkAdapter.isHoodieTable(table) && ct.query.forall(_.resolved) =>
CreateHoodieTableAsSelectCommand(table, mode, query)
+ case ct: CreateTable =>
+ // NOTE: In case of CreateTable with schema and multiple partition fields,
+ // we have to make sure that partition fields are ordered in the same way as they are in the schema.
+ HoodieSchemaUtils.checkPartitionSchemaOrder(ct.tableDesc.schema, ct.tableDesc.partitionColumnNames)
Review Comment:
Fixed.
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2242260003
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4551f0a1afb4409b4b67ad504e7d81843256c01c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903)
* 21fea17b816877dd6ef876818400de776e8056ae Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
Re: [PR] [HUDI-7964] Error out if partition schema and table schema do not match in create table command [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11650:
URL: https://github.com/apache/hudi/pull/11650#issuecomment-2242748776
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24903",
"triggerID" : "4551f0a1afb4409b4b67ad504e7d81843256c01c",
"triggerType" : "PUSH"
}, {
"hash" : "21fea17b816877dd6ef876818400de776e8056ae",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24942",
"triggerID" : "21fea17b816877dd6ef876818400de776e8056ae",
"triggerType" : "PUSH"
}, {
"hash" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943",
"triggerID" : "1828dc1d8e4e274ecf24b6514638dcfca2f65010",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 1828dc1d8e4e274ecf24b6514638dcfca2f65010 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24943)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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