ksbeyer commented on code in PR #52016:
URL: https://github.com/apache/spark/pull/52016#discussion_r2277634882
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -244,35 +215,57 @@ object TableOutputResolver extends SQLConfHelper with
Logging {
}
}
-
- private def canWrite(
+ private def verifyCanWrite(
tableName: String,
valueType: DataType,
expectedType: DataType,
byName: Boolean,
conf: SQLConf,
- addError: String => Unit,
- colPath: Seq[String]): Boolean = {
+ colPath: Seq[String]): Unit = {
conf.storeAssignmentPolicy match {
case StoreAssignmentPolicy.STRICT | StoreAssignmentPolicy.ANSI =>
- DataTypeUtils.canWrite(
+ DataTypeUtils.verifyCanWrite(
tableName, valueType, expectedType, byName, conf.resolver,
colPath.quoted,
- conf.storeAssignmentPolicy, addError)
+ conf.storeAssignmentPolicy)
case _ =>
- true
+ // LEGACY store assignment policy is disallowed in data source v2.
+ // todo: Is this method used by v1? Should it verify LEGACY writes? or
block them?
Review Comment:
removed todo and added comment
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -244,35 +215,57 @@ object TableOutputResolver extends SQLConfHelper with
Logging {
}
}
-
- private def canWrite(
+ private def verifyCanWrite(
tableName: String,
valueType: DataType,
expectedType: DataType,
byName: Boolean,
conf: SQLConf,
- addError: String => Unit,
- colPath: Seq[String]): Boolean = {
+ colPath: Seq[String]): Unit = {
conf.storeAssignmentPolicy match {
case StoreAssignmentPolicy.STRICT | StoreAssignmentPolicy.ANSI =>
- DataTypeUtils.canWrite(
+ DataTypeUtils.verifyCanWrite(
tableName, valueType, expectedType, byName, conf.resolver,
colPath.quoted,
- conf.storeAssignmentPolicy, addError)
+ conf.storeAssignmentPolicy)
case _ =>
- true
+ // LEGACY store assignment policy is disallowed in data source v2.
+ // todo: Is this method used by v1? Should it verify LEGACY writes? or
block them?
}
}
+ private def resolveColumns(tableName: String,
+ inputCols: Seq[NamedExpression],
+ expectedCols: Seq[Attribute],
+ conf: SQLConf,
+ byName: Boolean,
+ fillDefaultValue: Boolean,
+ colPath: Seq[String] = Nil): Seq[NamedExpression]
= {
Review Comment:
done
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]