Skip to content

Conversation

@simicd
Copy link
Contributor

@simicd simicd commented Jan 21, 2024

Which issue does this PR close?

#8213 (partially)

Rationale for this change

Port tests to sqllogictest

What changes are included in this PR?

  • Port five unit tests related to lists and structs to sqllogictest

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jan 21, 2024
Comment on lines 562 to 572
CREATE TABLE nested_structs_data
AS VALUES
(make_array(0, 1, 2, 3), 'a'),
(make_array(4, 5, 6, 7), 'b'),
(make_array(8, 9, 10, 11), 'c');

statement ok
CREATE TABLE nested_structs AS SELECT struct(column1) AS some_struct FROM nested_structs_data;

query ?
SELECT some_struct['c0'] as l0 FROM nested_structs LIMIT 3;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to create a struct with named fields other than c0, c1, ... in SQL? The original test called it bar, I couldn't find anywhere in the documentation or the code a way to name c0 differently.

Original test:
https://github.com/apache/arrow-datafusion/blob/0116e2a9b4a3ed4491802e19195769b96b7a971a/datafusion/core/tests/sql/select.rs#L149-L150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant