zeroshade commented on code in PR #477:
URL: https://github.com/apache/arrow-go/pull/477#discussion_r2282789332


##########
parquet/internal/encoding/typed_encoder.go:
##########
@@ -307,43 +307,36 @@ func (dc *dictConverter[T]) IsValid(idxes 
...utils.IndexType) bool {
        return min >= 0 && int(min) < len(dc.dict) && int(max) >= 0 && int(max) 
< len(dc.dict)
 }
 
-func (dc *dictConverter[T]) Fill(out any, val utils.IndexType) error {
-       o := out.([]T)
+func (dc *dictConverter[T]) IsValidSingle(idx utils.IndexType) bool {
+       dc.ensure(idx)
+       return int(idx) >= 0 && int(idx) < len(dc.dict)
+}
+
+func (dc *dictConverter[T]) Fill(o []T, val utils.IndexType) error {
        if err := dc.ensure(val); err != nil {
                return err
        }
-
        o[0] = dc.dict[val]
        for i := 1; i < len(o); i *= 2 {
                copy(o[i:], o[:i])
        }
        return nil
 }
 
-func (dc *dictConverter[T]) FillZero(out any) {
-       o := out.([]T)
+func (dc *dictConverter[T]) FillZero(o []T) {
        o[0] = dc.zeroVal
        for i := 1; i < len(o); i *= 2 {
                copy(o[i:], o[:i])
        }
 }
 
-func (dc *dictConverter[T]) Copy(out any, vals []utils.IndexType) error {
-       o := out.([]T)
+func (dc *dictConverter[T]) Copy(o []T, vals []utils.IndexType) error {
        for idx, val := range vals {
                o[idx] = dc.dict[val]
        }
        return nil
 }
 
-type Int32DictConverter = dictConverter[int32]
-type Int64DictConverter = dictConverter[int64]
-type Float32DictConverter = dictConverter[float32]
-type Float64DictConverter = dictConverter[float64]
-type Int96DictConverter = dictConverter[parquet.Int96]
-type ByteArrayDictConverter = dictConverter[parquet.ByteArray]
-type FixedLenByteArrayDictConverter = dictConverter[parquet.FixedLenByteArray]

Review Comment:
   These are publicly exported, why are we removing these aliases?



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to