You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "kazdy (via GitHub)" <gi...@apache.org> on 2023/02/23 23:45:51 UTC

[GitHub] [hudi] kazdy commented on issue #8020: [SUPPORT] org.apache.avro.AvroTypeException: Cannot encode decimal with precision 4 as max precision 2

kazdy commented on issue #8020:
URL: https://github.com/apache/hudi/issues/8020#issuecomment-1442581108

   Hi @xiarixiaoyao 
   wanted to chime in and mention that for Iceberg below is supported with Spark:
   `decimal(P,S) to decimal(P2,S) when P2 > P (scale cannot change)`
   https://iceberg.apache.org/docs/latest/spark-ddl/#alter-table--alter-column
   
   which is exactly what Simon described, decimal(2,0) to decimal(4,0) then 4 > 2.
   
   On the other hand, it seems like in Delta one can't change precision nor scale:
   https://github.com/delta-io/delta/blob/8b3fd4855deda50b20f27984d187961e7fd4a5a3/core/src/main/scala/org/apache/spark/sql/delta/schema/SchemaMergingUtils.scala#L237-L257
   


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