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

Support Struct Conversion when reading Arrow data #114

Closed
grundprinzip opened this issue Jan 6, 2025 · 4 comments
Closed

Support Struct Conversion when reading Arrow data #114

grundprinzip opened this issue Jan 6, 2025 · 4 comments
Labels
good first issue Good for newcomers

Comments

@grundprinzip
Copy link
Contributor

The following query fails:

_, err := spark.Sql(ctx, "SELECT struct(1, 'a') as col")
if err != nil {
    log.Fatalf("Failed: %s", err)
}

with the error:

2025/01/06 15:13:51 Failed: unsupported arrow data type STRUCT
@kronsbein
Copy link
Contributor

Hi @grundprinzip, I’m new to Spark Connect Go, but want to start contributing. I’d like to take this up if it’s still available.

@grundprinzip
Copy link
Contributor Author

Absolutely, please feel free to submit a PR!

@kronsbein
Copy link
Contributor

Great, thank you, will do! I was wondering about how to implement this dynamically when the structs schema is unknown. Would it make sense to convert them into a map[string]any, using field names as keys and field values as values? Or would it be better to use reflection to create and populate a generic struct type dynamically at runtime?

@grundprinzip
Copy link
Contributor Author

I think map[string]any is probably better because the receiver will have a hard time expecting the struct the right way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants