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

Extract_union doesnt return struct #419

Open
aastha25 opened this issue Jun 6, 2023 · 0 comments
Open

Extract_union doesnt return struct #419

aastha25 opened this issue Jun 6, 2023 · 0 comments

Comments

@aastha25
Copy link
Contributor

aastha25 commented Jun 6, 2023

PR #409 enabled the conversion of single union type hive field schema, such as uniontype<array<string>>, to array<string> in Coral's SqlNode & RelNode representation.

However, it breaks extract_union contract of returning only structs, 2- manages this new contract in another unrelated operator (DOT) with a method to guess the context as reported here . Hence, it needs to be revisited & should support the following scenarios across engines:

for a table foo: {a - int, b - uniontype<string>, c - uniontype<c1 - int, c2 - string, c3 - uniontype<string>>}

(1) select b from foo; // string
(2) select extract_union(b) from foo; // {tag_0:string}
(3) select extract_union(a) from foo; // {tag_0:string}
(4) select extract_union(c) from foo; // {c1: int, c2: string, c3: string}
(5) select extract_union(c).c3 from foo; // string
(6) select extract_union(c.c3) from foo; // {tag_0:string}

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