danny0405 commented on a change in pull request #4649:
URL: https://github.com/apache/hudi/pull/4649#discussion_r790104796
##########
File path:
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadIncrementalRelation.scala
##########
@@ -74,7 +74,8 @@ class MergeOnReadIncrementalRelation(val sqlContext:
SQLContext,
optParams.getOrElse(DataSourceReadOptions.END_INSTANTTIME.key,
lastInstant.getTimestamp))
log.debug(s"${commitsTimelineToReturn.getInstants.iterator().toList.map(f =>
f.toString).mkString(",")}")
private val commitsToReturn =
commitsTimelineToReturn.getInstants.iterator().toList
- private val schemaUtil = new TableSchemaResolver(metaClient)
+ private val withOperationField: Boolean = new
TableSchemaResolver(metaClient).hasOperationField
+ private val schemaUtil = new TableSchemaResolver(metaClient,
withOperationField)
Review comment:
We need to make things more clear here, `withOperationField` flag can
actually be eliminated if we have assumption:
`always show the __hoodie_operation field when the schema contains that`.
Then the resolve `withOperationField` can be made builtin in
`TableSchemaResolver`.
To make sure the assumption, you should check all the use cases that pass
`true` as `withOperationField` for `TableSchemaResolver`.
##########
File path:
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/TestInsertTable.scala
##########
@@ -17,7 +17,7 @@
package org.apache.spark.sql.hudi
-import org.apache.hudi.DataSourceWriteOptions.{KEYGENERATOR_CLASS_NAME,
MOR_TABLE_TYPE_OPT_VAL, PARTITIONPATH_FIELD, PRECOMBINE_FIELD, RECORDKEY_FIELD,
TABLE_TYPE}
+import org.apache.hudi.DataSourceWriteOptions._
Review comment:
We better not import star (*)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]