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

Add a feature to collapse structs or the output data #685

Closed
yruslan opened this issue Jun 4, 2024 · 0 comments · Fixed by #687
Closed

Add a feature to collapse structs or the output data #685

yruslan opened this issue Jun 4, 2024 · 0 comments · Fixed by #687
Labels
enhancement New feature or request

Comments

@yruslan
Copy link
Collaborator

yruslan commented Jun 4, 2024

Background

Currently, we have 2 options for schema transformation:

.option("schema_retention_policy", "keep_original") 
.option("schema_retention_policy", "collapse_root") 

Field names in mainframe copybooks are usually unique, even if they are part of nested structs. Cobrix can remove all nesting until an array or a primitive is encountered.

Feature

Add a feature to collapse structs or the output data.

Example [Optional]

A simple example if applicable.

Proposed Solution [Optional]

Solution Ideas

  1. Add a new option
    .option("schema_retention_policy", "collapse_struct") 
    that unstructs on-fly.
    OR
  2. Add a method to SparkUtils that unstructs as a post-processing.
@yruslan yruslan added the enhancement New feature or request label Jun 4, 2024
yruslan added a commit that referenced this issue Jun 5, 2024
This is similar to flattening, but does not flatten arrays, and it is more efficient.
yruslan added a commit that referenced this issue Jun 5, 2024
This is similar to flattening, but does not flatten arrays, and it is more efficient.
yruslan added a commit that referenced this issue Jun 5, 2024
This is similar to flattening, but does not flatten arrays, and it is more efficient.
yruslan added a commit that referenced this issue Jun 6, 2024
This is similar to flattening, but does not flatten arrays, and it is more efficient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant