Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json schema for 2 level json #555

Open
vishwaratna opened this issue Aug 18, 2023 · 0 comments
Open

Json schema for 2 level json #555

vishwaratna opened this issue Aug 18, 2023 · 0 comments

Comments

@vishwaratna
Copy link

vishwaratna commented Aug 18, 2023

Hi, I am following json schema example https://github.com/xitongsys/parquet-go/blob/master/example/json_schema.go for reference.
I have struct which looks like below:

type DataTwoLevel struct {
	ColumnsChangedJson     []struct {
		SourceSystemName string
		Id               int64
		Demographics     []struct {
			Country  string
			Language string
		}
	}
}

I am trying to create a json schema for the same but not able to do so, can someone help me with a concrete example?

My current schema is as below, but it does not work.

`{
  "Tag": "name=parquet_go_root, repetitiontype=REQUIRED",
  "Fields": [
    {
      "Tag": "name=columnsChangedJson, inname=ColumnsChangedJson, type=LIST, repetitiontype=REQUIRED",
      "Fields": [
       {"Tag": "name=element, repetitiontype=REQUIRED",
        "Fields": [
         {"Tag": "name=sourceSystemName, inname=SourceSystemName, type=BYTE_ARRAY, repetitiontype=REQUIRED"},
         {"Tag": "name=id, inname=Id, type=INT64, repetitiontype=REQUIRED"}
         {"Tag": "name=demographics, inname=Demographics, type=LIST, repetitiontype=REQUIRED",
         "Fields": [
           {"Tag": "name=element, repetitiontype=REQUIRED",
             "Fields": [
              {"Tag": "name=country, inname=Country, type=BYTE_ARRAY, repetitiontype=REQUIRED"},
              {"Tag": "name=language, inname=Language, type=BYTE_ARRAY, repetitiontype=REQUIRED"}
           ]}
         ]}
        ]}
      ]
    }
  ]
}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant