Skip to content

feat: Support CompoundIdentifier as GetIndexedField access#2454

Merged
alamb merged 1 commit intoapache:masterfrom
cube-js:compound-identifier-get-indexed-array
May 6, 2022
Merged

feat: Support CompoundIdentifier as GetIndexedField access#2454
alamb merged 1 commit intoapache:masterfrom
cube-js:compound-identifier-get-indexed-array

Conversation

@ovr
Copy link
Copy Markdown
Contributor

@ovr ovr commented May 5, 2022

Which issue does this PR close?

I didn't create a new issue for it.

Rationale for this change

Right now, DF supports GetIndexed access on top of MapAccessExpr, which is not correct for PostgreSQL dialect.

For example:

/// DF supports it, but It doesn't work with PostgreSQL
SELECT (information_schema._pg_expandarray(ARRAY [1,2,3,4]))["x"];

/// This PR introduce the correct style of accessing a field of structure, Works with PostgreSQL
SELECT (information_schema._pg_expandarray(ARRAY [1,2,3,4])).x;

What changes are included in this PR?

From subject.

@ovr ovr changed the title feat: Support CompoundIdentifier access as GetIndexedField feat: Support CompoundIdentifier as GetIndexedField access May 5, 2022
Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

👍 thank you @ovr

name,
}))
if let Some(field) = schema.fields().iter().find(|f| f.name().eq(&relation)) {
// Access to a field of a column which is a structure, example: SELECT my_struct.key
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

makes sense to me 👍 Nice work @ovr

@alamb alamb merged commit 9c1b462 into apache:master May 6, 2022
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

Successfully merging this pull request may close these issues.

2 participants