You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "candiduslynx (via GitHub)" <gi...@apache.org> on 2023/05/25 14:11:23 UTC

[GitHub] [arrow] candiduslynx commented on a diff in pull request #35687: GH-35686:[Go] Add AppendTime to TimestampBuilder

candiduslynx commented on code in PR #35687:
URL: https://github.com/apache/arrow/pull/35687#discussion_r1205581278


##########
go/arrow/type_traits_test.go:
##########
@@ -233,3 +233,37 @@ func TestMonthDayNanoIntervalTraits(t *testing.T) {
 		t.Fatalf("invalid values:\nv1=%v\nv2=%v\n", v1, v2)
 	}
 }
+
+func TestTimestampTraits(t *testing.T) {
+	const N = 10
+	b1 := arrow.TimestampTraits.CastToBytes([]arrow.Timestamp{
+		0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+	})
+
+	b2 := make([]byte, arrow.TimestampTraits.BytesRequired(N))
+	for i := 0; i < N; i++ {
+		beg := i * arrow.TimestampSizeBytes
+		end := (i + 1) * arrow.TimestampSizeBytes
+		arrow.TimestampTraits.PutValue(b2[beg:end], arrow.Timestamp(i))
+	}
+
+	if !reflect.DeepEqual(b1, b2) {

Review Comment:
   I just copy-pasted from the generated code. I can fix it here, if you insist.



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