-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-39639][SQL] Fix possible null pointer in MySQLDialect listIndexes #37031
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
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 |
|---|---|---|
|
|
@@ -23,6 +23,8 @@ import java.util.Locale | |
|
|
||
| import scala.collection.mutable.ArrayBuilder | ||
|
|
||
| import org.apache.commons.lang3.StringUtils | ||
|
|
||
| import org.apache.spark.sql.AnalysisException | ||
| import org.apache.spark.sql.catalyst.SQLConfHelper | ||
| import org.apache.spark.sql.catalyst.analysis.{IndexAlreadyExistsException, NoSuchIndexException} | ||
|
|
@@ -217,7 +219,7 @@ private case object MySQLDialect extends JdbcDialect with SQLConfHelper { | |
| // The only property we are building here is `COMMENT` because it's the only one | ||
| // we can get from `SHOW INDEXES`. | ||
| val properties = new util.Properties(); | ||
| if (indexComment.nonEmpty) properties.put("COMMENT", indexComment) | ||
|
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. Seems to me if
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.
mysql> desc INFORMATION_SCHEMA.STATISTICS;
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 will close it, but maybe we need add some UT for it.I will open new pr for it.
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. Updated:
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.
Sounds good to me. I will take a look at the new PR.
It's OK to implement these.
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. @huaxingao implement for h2 dialect: #37112 |
||
| if (StringUtils.isNotEmpty(indexComment)) properties.put("COMMENT", indexComment) | ||
| val index = new TableIndex(indexName, indexType, Array(FieldReference(colName)), | ||
| new util.HashMap[NamedReference, util.Properties](), properties) | ||
| indexMap += (indexName -> index) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.