Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

panic: cannot create parquet value of type DOUBLE from go value of type [][]float64 #473

Open
yonesko opened this issue Feb 8, 2023 · 0 comments

Comments

@yonesko
Copy link
Contributor

yonesko commented Feb 8, 2023

Hello!
I have json row:

{
  "geo_geo_bbox": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          -79.76259,
          40.477383
        ],
        [
          -79.76259,
          45.015851
        ],
        [
          -71.777492,
          45.015851
        ],
        [
          -71.777492,
          40.477383
        ],
        [
          -79.76259,
          40.477383
        ]
      ]
    ]
  }
}

Which I try to write into Parquet.
I generated golang struct:

&struct { 
	Geo_geo_bbox struct { 
		Type string "parquet:\"type,optional,plain\" json:\"type\" csv:\"type\""; 
		Coordinates [][][]float64 "parquet:\"coordinates,optional,list\" json:\"coordinates\" csv:\"coordinates\"" 
	} "parquet:\"geo_geo_bbox,optional\" json:\"geo_geo_bbox\" csv:\"geo_geo_bbox\"" 
}
{
	Type:"Polygon", 
	Coordinates:[][][]float64 {
		[][]float64{
			[]float64{-79.76259, 40.477383}, 
			[]float64{-79.76259, 45.015851}, 
			[]float64{-71.777492, 45.015851}, 
			[]float64{-71.777492, 40.477383}, 
			[]float64{-79.76259, 40.477383}
		}
	}
}
}

and your lib created a Shema:

message SomeMsg {
	optional group geo_geo_bbox {
		optional binary type (STRING);
		optional group coordinates (LIST) {
			repeated group list {
				repeated double element;
			}
		}
	}
}

and I get error during parquetWriter.Write(row):

panic: cannot create parquet value of type DOUBLE from go value of type [][]float64

Any ideas ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant