You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2023/04/26 00:04:33 UTC

[GitHub] [arrow] kou commented on a diff in pull request #35338: GH-35337: [Go] ASAN tests fail with Go1.20+

kou commented on code in PR #35338:
URL: https://github.com/apache/arrow/pull/35338#discussion_r1177169685


##########
go/arrow/array/numericbuilder.gen.go.tmpl:
##########
@@ -225,23 +225,23 @@ func (b *{{.Name}}Builder) AppendValueFromString(s string) error {
     }
     b.Append(v)
   {{else if (eq .Name "Duration") -}}	
-    return fmt.Errorf("%w: AppendValueFromString not implemented for Duration", ErrNotImplemented)
+    return fmt.Errorf("%w: AppendValueFromString not implemented for Duration", arrow.ErrNotImplemented)
   {{else if or (eq .Name "Int8") (eq .Name "Int16") (eq .Name "Int32") (eq .Name "Int64") -}}
-    v, err := strconv.ParseInt(s, 10, {{.Size}})
+    v, err := strconv.ParseInt(s, 10, {{.Size}}*8)

Review Comment:
   ```suggestion
       v, err := strconv.ParseInt(s, 10, {{.Size}} * 8)
   ```



##########
go/arrow/compute/arithmetic.go:
##########
@@ -343,11 +343,11 @@ NaN values return NaN. Integral values return signedness as Int8,
 and floating-point values return it with the same type as the input values.`,
 		ArgNames: []string{"x"},
 	}
-	bitWiseNotDoc = FunctionDoc{
-		Summary:     "Bit-wise negate the arguments element-wise",
-		Description: "Null values return null",
-		ArgNames:    []string{"x"},
-	}
+	// bitWiseNotDoc = FunctionDoc{
+	// 	Summary:     "Bit-wise negate the arguments element-wise",
+	// 	Description: "Null values return null",
+	// 	ArgNames:    []string{"x"},
+	// }

Review Comment:
   Is this intended?
   Should we use it instead of commenting out this?
   
   ```diff
   diff --git a/go/arrow/compute/arithmetic.go b/go/arrow/compute/arithmetic.go
   index 45d8d7738..e89077cf3 100644
   --- a/go/arrow/compute/arithmetic.go
   +++ b/go/arrow/compute/arithmetic.go
   @@ -909,7 +909,7 @@ func RegisterScalarArithmetic(reg FunctionRegistry) {
    		reg.AddFunction(fn, false)
    	}
    
   -	fn = &arithmeticFunction{*NewScalarFunction("bit_wise_not", Unary(), EmptyFuncDoc), decPromoteNone}
   +	fn = &arithmeticFunction{*NewScalarFunction("bit_wise_not", Unary(), BitWiseNotDoc), decPromoteNone}
    	for _, k := range kernels.GetBitwiseUnaryKernels() {
    		if err := fn.AddKernel(k); err != nil {
    			panic(err)
   ```



##########
go/arrow/array/numericbuilder.gen.go.tmpl:
##########
@@ -225,23 +225,23 @@ func (b *{{.Name}}Builder) AppendValueFromString(s string) error {
     }
     b.Append(v)
   {{else if (eq .Name "Duration") -}}	
-    return fmt.Errorf("%w: AppendValueFromString not implemented for Duration", ErrNotImplemented)
+    return fmt.Errorf("%w: AppendValueFromString not implemented for Duration", arrow.ErrNotImplemented)
   {{else if or (eq .Name "Int8") (eq .Name "Int16") (eq .Name "Int32") (eq .Name "Int64") -}}
-    v, err := strconv.ParseInt(s, 10, {{.Size}})
+    v, err := strconv.ParseInt(s, 10, {{.Size}}*8)
     if err != nil {
         b.AppendNull()
         return err
     }
     b.Append({{.name}}(v))
   {{else if or (eq .Name "Uint8") (eq .Name "Uint16") (eq .Name "Uint32") (eq .Name "Uint64") -}}
-    v, err := strconv.ParseUint(s, 10, {{.Size}})
+    v, err := strconv.ParseUint(s, 10, {{.Size}}*8)

Review Comment:
   ```suggestion
       v, err := strconv.ParseUint(s, 10, {{.Size}} * 8)
   ```



##########
go/internal/hashing/hash_string.go:
##########
@@ -0,0 +1,30 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//go:build !go1.20

Review Comment:
   Does this work with go1.21 or later?
   (I think that the answer is "no".)
   
   Can we use `//go:build <go1.20` or something?



-- 
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-unsubscribe@arrow.apache.org

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