This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-go.git
The following commit(s) were added to refs/heads/main by this push:
new 387d209c fix(table): add warnings for silent data-affecting behavior
(#811)
387d209c is described below
commit 387d209c8baddf7e3a7efaa0a33c8572937e3897
Author: Andrei Tserakhau <[email protected]>
AuthorDate: Fri Mar 27 21:31:09 2026 +0100
fix(table): add warnings for silent data-affecting behavior (#811)
Replace TODO/placeholder comments with log.Printf warnings for two cases
that silently affect data without notifying the caller:
- Nanosecond timestamp downcast to microsecond (precision loss)
- Unrecognized compression codec falling back to uncompressed
It's better then nothing
Closes #797
---
table/arrow_utils.go | 3 ++-
table/internal/parquet_files.go | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/table/arrow_utils.go b/table/arrow_utils.go
index 3215512d..6af3af4b 100644
--- a/table/arrow_utils.go
+++ b/table/arrow_utils.go
@@ -23,6 +23,7 @@ import (
"encoding/json"
"fmt"
"iter"
+ "log/slog"
"slices"
"strconv"
"strings"
@@ -343,7 +344,7 @@ func (c convertToIceberg) Primitive(dt arrow.DataType)
(result iceberg.NestedFie
if !c.downcastTimestamp {
panic(fmt.Errorf("%w: 'ns' timestamp precision
not supported", iceberg.ErrType))
}
- // TODO: log something
+ slog.Warn("downcasting nanosecond timestamp to
microsecond, precision loss may occur")
}
if slices.Contains(utcAliases, dt.TimeZone) {
diff --git a/table/internal/parquet_files.go b/table/internal/parquet_files.go
index a78c2d34..68067b9c 100644
--- a/table/internal/parquet_files.go
+++ b/table/internal/parquet_files.go
@@ -253,7 +253,7 @@ func (parquetFormat) GetWriteProperties(props
iceberg.Properties) any {
case "lzo":
codec = compress.Codecs.Lzo
default:
- // warn
+ slog.Warn("unrecognized compression codec, falling back to
uncompressed", "codec", compression)
}
return append(writerProps, parquet.WithCompression(codec),