-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-36913][SQL] Implement createIndex and IndexExists in DS V2 JDBC (MySQL dialect) #34164
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
Changes from 8 commits
8e4bfc8
4163b3c
2b4424f
806baf7
b9fa9ca
5719ad8
3a358dc
2e01b2f
f6c967f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,5 +180,18 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu | |
| testCreateTableWithProperty(s"$catalogName.new_table") | ||
| } | ||
| } | ||
|
|
||
| def supportsIndex: Boolean = false | ||
| def testIndex(tbl: String): Unit = {} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you want to add some test code here? If this is empty, the following test case is invalid.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I intentionally leave it empty and let the subclass (e.g.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that we leave it empty because other dialects do not support index yet. how about
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
|
|
||
| test("SPARK-36913: Test INDEX") { | ||
| if (supportsIndex) { | ||
| withTable(s"$catalogName.new_table") { | ||
| sql(s"CREATE TABLE $catalogName.new_table(col1 INT, col2 INT, col3 INT," + | ||
| s" col4 INT, col5 INT)") | ||
| testIndex(s"$catalogName.new_table") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we still need the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still need the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then the only shared test code is the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually we can put more common code such as
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we will share more test code with |
||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,14 +40,14 @@ public interface SupportsIndex extends Table { | |
| * @param indexName the name of the index to be created | ||
| * @param indexType the IndexType of the index to be created | ||
| * @param columns the columns on which index to be created | ||
| * @param columnProperties the properties of the columns on which index to be created | ||
| * @param columnsProperties the properties of the columns on which index to be created | ||
| * @param properties the properties of the index to be created | ||
| * @throws IndexAlreadyExistsException If the index already exists (optional) | ||
| */ | ||
| void createIndex(String indexName, | ||
| String indexType, | ||
| NamedReference[] columns, | ||
| Map<NamedReference, Properties>[] columnProperties, | ||
| Map<NamedReference, Properties>[] columnsProperties, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| Properties properties) | ||
| throws IndexAlreadyExistsException; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.