mzzz-zzm opened a new pull request, #1121: URL: https://github.com/apache/iceberg-go/pull/1121
DecimalLiteral.Type() hardcodes precision 9 because DecimalLiteral does not carry the originating column's declared precision. The only confirmed consumer that mis-uses this is toDecimalLiteral in table/substrait/substrait.go, which embedded the wrong precision in emitted Substrait literals for any column with precision != 9. Per the Option B consensus on #1028: 1. toDecimalLiteral now reads precision from the bound field's iceberg.DecimalType rather than v.Type(). 2. Replaces the latent panic v.Type().(*iceberg.DecimalType) with the correct value-type assertion v.Type().(iceberg.DecimalType); DecimalTypeOf returns by value. 3. Documents the precision caveat on DecimalLiteral.Type() so future callers consult the bound field type for real precision. 4. Adds whitebox regression tests for the bound-field path and the defensive fallback path. Fixes #1028 -- 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]
