You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "xiarixiaoyao (via GitHub)" <gi...@apache.org> on 2023/04/13 11:58:23 UTC
[GitHub] [hudi] xiarixiaoyao commented on a diff in pull request #8450: [HUDI-6073] Table create schema should not include metadata fields
xiarixiaoyao commented on code in PR #8450:
URL: https://github.com/apache/hudi/pull/8450#discussion_r1165419086
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/TestCreateTable.scala:
##########
@@ -86,6 +87,14 @@ class TestCreateTable extends HoodieSparkSqlTestBase {
assertResult(tableName)(tableConfig.getTableName)
assertFalse(tableConfig.contains(OPERATION.key()))
+ val schemaOpt = tableConfig.getTableCreateSchema
+ assertTrue(schemaOpt.isPresent, "Table create schema should be persisted")
+ val noMetadataFields = schemaOpt.get().getFields.stream()
+ .noneMatch(new Predicate[Field] {
+ override def test(f: Field): Boolean = HoodieRecord.HOODIE_META_COLUMNS.contains(f.name())
+ })
+ assertTrue(noMetadataFields, "Table create schema should not include metadata fields")
+
Review Comment:
assertFalse(schemaOpt.get().getFields.asScala.find(f => HoodieRecord.HOODIE_META_COLUMNS.contains(f.name())).isDefined,
"Table create schema should not include metadata fields")
--
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