surawut-jirasaktavee commented on code in PR #7680:
URL: https://github.com/apache/datafusion-comet/pull/7680#discussion_r4638582962
##########
spark/src/main/scala/org/apache/comet/serde/operator/CometIcebergNativeWrite.scala:
##########
@@ -1054,21 +1066,35 @@ object CometIcebergNativeWrite extends
CometOperatorSerde[IcebergWriteExec] {
.toMap + (CometS3CredentialProviderClassProperty ->
HadoopS3ACredentialAdapterClass)
/** Return unsupported FileIO S3/client property names in deterministic
order. */
- private[comet] def unsupportedS3FileIOProperties(properties: Map[String,
String]): Seq[String] =
- unsupportedS3FileIOProperties(properties, IcebergAwsProperties)
+ private[comet] def unsupportedS3FileIOProperties(
+ properties: Map[String, String],
+ s3FileIO: Boolean = false): Seq[String] =
+ unsupportedS3FileIOProperties(properties, IcebergAwsProperties, s3FileIO)
private[comet] def unsupportedS3FileIOProperties(
properties: Map[String, String],
- icebergAwsProperties: IcebergAwsPropertyNames): Seq[String] = {
+ icebergAwsProperties: IcebergAwsPropertyNames,
+ s3FileIO: Boolean): Seq[String] = {
val customCredentialProviderConfigured = properties
.get(CometS3CredentialProviderClassProperty)
.exists(_.trim.nonEmpty)
+ val assumeRole = usesAssumeRoleClientFactory(properties)
Review Comment:
Fixed here. `client.assume-role.arn`, `external-id` and `session-name` are
no longer in `SupportedS3FileIOProperties`. They are admitted only together
with `client.factory=AssumeRoleAwsClientFactory`, a non-blank arn and region,
and `S3FileIO`, so an ARN without the factory now falls back. I updated the
existing supported-keys test and added a case for the assume-role keys without
the factory
##########
spark/src/main/scala/org/apache/comet/serde/operator/CometIcebergNativeWrite.scala:
##########
@@ -1079,9 +1105,37 @@ object CometIcebergNativeWrite extends
CometOperatorSerde[IcebergWriteExec] {
}
.map(_._1)
.toSeq
+ .++(assumeRoleConflicts)
+ .distinct
.sorted
}
+ private def assumeRoleConflictingProperties(properties: Map[String,
String]): Seq[String] = {
+ val region = properties(AssumeRoleRegionProperty)
+ Seq(CometS3CredentialProviderClassProperty).filter(
+ properties.get(_).exists(_.trim.nonEmpty)) ++
+ NativeS3RegionProperties.filter(properties.get(_).exists(_ != region)) ++
+ AssumeRoleConflictingCredentialProperties.filter(properties.contains) ++
+ AssumeRoleConflictingCredentialFlags.filter(
+ properties.get(_).exists(java.lang.Boolean.parseBoolean))
Review Comment:
Fixed. `s3.allow-anonymous`, `s3.disable-ec2-metadata` and
`s3.disable-config-load` now use the same rule as iceberg-rust's `is_truthy`
(`true`, `t`, `1`, `on`, case-insensitive), so any of those spellings falls
back with the factory. The test now also covers `1`, `T` and `on`
--
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]