You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/02 11:29:25 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #7292: ARROW-8471: [C++][Integration] Represent 64 bit integers as strings

pitrou commented on a change in pull request #7292:
URL: https://github.com/apache/arrow/pull/7292#discussion_r433805733



##########
File path: go/arrow/internal/arrjson/arrjson.go
##########
@@ -963,19 +963,23 @@ func i32ToJSON(arr *array.Int32) []interface{} {
 func i64FromJSON(vs []interface{}) []int64 {
 	o := make([]int64, len(vs))
 	for i, v := range vs {
-		vv, err := v.(json.Number).Int64()
+		vv, err := strconv.ParseInt(v.(string), 10, 64)
 		if err != nil {
 			panic(err)
 		}
-		o[i] = int64(vv)
+		o[i] = vv
 	}
 	return o
 }
 
 func i64ToJSON(arr *array.Int64) []interface{} {
 	o := make([]interface{}, arr.Len())
 	for i := range o {
-		o[i] = arr.Value(i)
+    if arr.IsValid(i) {

Review comment:
       Indentation problem here?

##########
File path: go/arrow/internal/arrjson/arrjson.go
##########
@@ -1330,7 +1350,11 @@ func durationFromJSON(vs []interface{}) []arrow.Duration {
 func durationToJSON(arr *array.Duration) []interface{} {
 	o := make([]interface{}, arr.Len())
 	for i := range o {
-		o[i] = arr.Value(i)
+    if arr.IsValid(i) {

Review comment:
       And here.

##########
File path: go/arrow/internal/arrjson/arrjson.go
##########
@@ -1205,7 +1213,11 @@ func date64FromJSON(vs []interface{}) []arrow.Date64 {
 func date64ToJSON(arr *array.Date64) []interface{} {
 	o := make([]interface{}, arr.Len())
 	for i := range o {
-		o[i] = int64(arr.Value(i))
+    if arr.IsValid(i) {

Review comment:
       And here as well.

##########
File path: go/arrow/internal/arrjson/arrjson.go
##########
@@ -1265,7 +1281,11 @@ func timestampFromJSON(vs []interface{}) []arrow.Timestamp {
 func timestampToJSON(arr *array.Timestamp) []interface{} {
 	o := make([]interface{}, arr.Len())
 	for i := range o {
-		o[i] = int64(arr.Value(i))
+    if arr.IsValid(i) {

Review comment:
       And here.

##########
File path: go/arrow/internal/arrjson/arrjson.go
##########
@@ -1245,15 +1257,19 @@ func time64FromJSON(vs []interface{}) []arrow.Time64 {
 func time64ToJSON(arr *array.Time64) []interface{} {
 	o := make([]interface{}, arr.Len())
 	for i := range o {
-		o[i] = int64(arr.Value(i))
+    if arr.IsValid(i) {

Review comment:
       And here.

##########
File path: go/arrow/internal/arrjson/arrjson.go
##########
@@ -1043,19 +1047,23 @@ func u32ToJSON(arr *array.Uint32) []interface{} {
 func u64FromJSON(vs []interface{}) []uint64 {
 	o := make([]uint64, len(vs))
 	for i, v := range vs {
-		vv, err := strconv.ParseUint(v.(json.Number).String(), 10, 64)
+		vv, err := strconv.ParseUint(v.(string), 10, 64)
 		if err != nil {
 			panic(err)
 		}
-		o[i] = uint64(vv)
+		o[i] = vv
 	}
 	return o
 }
 
 func u64ToJSON(arr *array.Uint64) []interface{} {
 	o := make([]interface{}, arr.Len())
 	for i := range o {
-		o[i] = arr.Value(i)
+    if arr.IsValid(i) {

Review comment:
       Indentation problem here as well?




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

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