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

[HZ-566] SQL: CREATE INDEX implementation #19810

Merged
merged 31 commits into from
Nov 9, 2021

Conversation

Fly-Style
Copy link
Member

@Fly-Style Fly-Style commented Oct 18, 2021

CREATE INDEX was fully implemented.
Grammar :

CREATE INDEX [ IF NOT EXISTS ] name ON map_name ( column_name [, ...] )
[ TYPE ( SORTED | HASH | BITMAP ) ]  
[ OPTIONS ( 'option_name' = 'option_value' [, ...] ) ]

Options are available only for BITMAP index since it has additional BitmapIndexConfig. Those options are supported:

  • unique_key
  • unique_key_transformation.

In case of SORTED/HASH index, options usage causes QueryException.

DROP INDEX syntax was supported, but not the execution path (DROP INDEX query throws UnsupportedException).

Checklist:

  • Labels (Team:, Type:, Source:, Module:) and Milestone set
  • Label Add to Release Notes or Not Release Notes content set
  • Request reviewers if possible

@Fly-Style Fly-Style added Type: Enhancement Source: Internal PR or issue was opened by an employee Team: SQL labels Oct 18, 2021
@Fly-Style Fly-Style added this to the 5.1 milestone Oct 18, 2021
@Fly-Style Fly-Style self-assigned this Oct 18, 2021
@Fly-Style Fly-Style marked this pull request as ready for review October 20, 2021 12:29
@hazelcast hazelcast deleted a comment from hz-devops-test Oct 20, 2021
@hazelcast hazelcast deleted a comment from hz-devops-test Oct 20, 2021
@hazelcast hazelcast deleted a comment from hz-devops-test Oct 20, 2021
@Fly-Style Fly-Style marked this pull request as draft October 20, 2021 15:31
@Fly-Style Fly-Style marked this pull request as ready for review October 21, 2021 06:28
@hazelcast hazelcast deleted a comment from hz-devops-test Oct 21, 2021
@hazelcast hazelcast deleted a comment from hz-devops-test Oct 27, 2021
}

@Test
public void indexArgsCannotBeDuplicatedTest() {
Copy link
Contributor

@viliam-durina viliam-durina Nov 8, 2021

Choose a reason for hiding this comment

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

We don't test duplicate options.

Copy link
Member Author

Choose a reason for hiding this comment

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

For map.addIndex(IndexType.SORTED, "this", "this"); :

java.lang.IllegalArgumentException: Duplicate attribute name [attributeName=this, indexConfig=IndexConfig{name=null, type=SORTED, attributes=[this, this]}]

Copy link
Member Author

Choose a reason for hiding this comment

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

It means, both test and check are makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean duplicate OPTIONS, not attributes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, sorry. You pointed to indexArgsCannotBeDuplicatedTest(), and I immediately switched to args context :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I always add comments to some code line. Comments added to the whole PR cannot be marked as resolved.

@hazelcast hazelcast deleted a comment from hz-devops-test Nov 8, 2021
@hazelcast hazelcast deleted a comment from hz-devops-test Nov 8, 2021
@hazelcast hazelcast deleted a comment from hz-devops-test Nov 8, 2021
…for existing index + IF NOT EXISTS in the next query, add new permission for index creation
@Fly-Style Fly-Style merged commit 6f0d889 into hazelcast:master Nov 9, 2021
@Fly-Style Fly-Style deleted the feat/5.1/create-index branch November 9, 2021 13:07
@Fly-Style Fly-Style restored the feat/5.1/create-index branch November 11, 2021 12:14
sancar pushed a commit to sancar/hazelcast that referenced this pull request Dec 13, 2021
Co-authored-by: Viliam Durina <viliam@hazelcast.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants