HyukjinKwon opened a new pull request, #38547:
URL: https://github.com/apache/spark/pull/38547

   ### What changes were proposed in this pull request?
   
   This PR disables ANSI at the test case for DSv2 because such partition 
casting wasn't supported in the legacy behaviour as well (with ANSI mode on).
   
   ### Why are the changes needed?
   
   To recover the ANSI enabled tests. Currently it fails as below:
   
   https://github.com/apache/spark/actions/runs/3406894388/jobs/5665999638
   
   ```
   - ALTER TABLE .. ADD PARTITION using V2 catalog V2 command: SPARK-40798: 
Alter partition should verify partition value - legacy *** FAILED *** (18 
milliseconds)
     org.apache.spark.SparkNumberFormatException: [CAST_INVALID_INPUT] The 
value 'aaa' of the type "STRING" cannot be cast to "INT" because it is 
malformed. Correct the value as per the syntax, or change its target type. Use 
`try_cast` to tolerate malformed input and return NULL instead. If necessary 
set "spark.sql.ansi.enabled" to "false" to bypass this error.
   == SQL(line 1, position 1) ==
   ALTER TABLE test_catalog.ns.tbl ADD PARTITION (p='aaa')
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     at 
org.apache.spark.sql.errors.QueryExecutionErrors$.invalidInputInCastToNumberError(QueryExecutionErrors.scala:161)
     at 
org.apache.spark.sql.catalyst.util.UTF8StringUtils$.withException(UTF8StringUtils.scala:51)
     at 
org.apache.spark.sql.catalyst.util.UTF8StringUtils$.toIntExact(UTF8StringUtils.scala:34)
     at 
org.apache.spark.sql.catalyst.expressions.Cast.$anonfun$castToInt$2(Cast.scala:927)
     at 
org.apache.spark.sql.catalyst.expressions.Cast.$anonfun$castToInt$2$adapted(Cast.scala:927)
     at org.apache.spark.sql.catalyst.expressions.Cast.buildCast(Cast.scala:588)
     at 
org.apache.spark.sql.catalyst.expressions.Cast.$anonfun$castToInt$1(Cast.scala:927)
     at 
org.apache.spark.sql.catalyst.expressions.Cast.nullSafeEval(Cast.scala:1285)
     at 
org.apache.spark.sql.catalyst.expressions.UnaryExpression.eval(Expression.scala:526)
     at 
org.apache.spark.sql.catalyst.analysis.ResolvePartitionSpec$.$anonfun$convertToPartIdent$1(ResolvePartitionSpec.scala:83)
     at scala.collection.immutable.List.map(List.scala:293)
     at 
org.apache.spark.sql.catalyst.analysis.ResolvePartitionSpec$.convertToPartIdent(ResolvePartitionSpec.scala:79)
     at 
org.apache.spark.sql.catalyst.analysis.ResolvePartitionSpec$.org$apache$spark$sql$catalyst$analysis$ResolvePartitionSpec$$resolvePartitionSpec(ResolvePartitionSpec.scala:72)
     at 
org.apache.spark.sql.catalyst.analysis.ResolvePartitionSpec$$anonfun$apply$2$$anonfun$applyOrElse$1.applyOrElse(ResolvePartitionSpec.scala:49)
     at 
org.apache.spark.sql.catalyst.analysis.ResolvePartitionSpec$$anonfun$apply$2$$anonfun$applyOrElse$1.applyOrElse(ResolvePartitionSpec.scala:42)
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, test-only.
   
   ### How was this patch tested?
   
   Manually tested locally.


-- 
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]

Reply via email to