-
Notifications
You must be signed in to change notification settings - Fork 29k
[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 all 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,14 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu | |
| testCreateTableWithProperty(s"$catalogName.new_table") | ||
| } | ||
| } | ||
|
|
||
| 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") { | ||
| withTable(s"$catalogName.new_table") { | ||
| sql(s"CREATE TABLE $catalogName.new_table(col1 INT, col2 INT, col3 INT, col4 INT, col5 INT)") | ||
| testIndex(s"$catalogName.new_table") | ||
|
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. I am not sure if you want to put all index test code (create, list, delete...) together into one test method. Sounds better to have individual test methods for different APIs.
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. might be more logical to put these in one test method? In next PR, I will add |
||
| } | ||
| } | ||
| } | ||
|
|
||
| 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.