-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add where clause support in create statement #2366
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 |
---|---|---|
|
@@ -174,6 +174,7 @@ SHOW: 'SHOW'; | |
TRUE: 'TRUE'; | ||
VIEW: 'VIEW'; | ||
VIEWS: 'VIEWS'; | ||
WHERE: 'WHERE'; | ||
WITH: 'WITH'; | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
|
||
package org.opensearch.sql.spark.dispatcher.model; | ||
|
||
import static org.apache.commons.lang3.StringUtils.strip; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import org.apache.commons.lang3.StringUtils; | ||
|
@@ -83,32 +85,19 @@ public String openSearchIndexName() { | |
switch (getIndexType()) { | ||
case COVERING: | ||
indexName = | ||
"flint" | ||
+ "_" | ||
+ StringUtils.strip(fullyQualifiedTableName.getDatasourceName(), STRIP_CHARS) | ||
+ "_" | ||
+ StringUtils.strip(fullyQualifiedTableName.getSchemaName(), STRIP_CHARS) | ||
"flint_" | ||
+ fullyQualifiedTableName.toFlintName() | ||
+ "_" | ||
+ StringUtils.strip(fullyQualifiedTableName.getTableName(), STRIP_CHARS) | ||
+ "_" | ||
+ StringUtils.strip(getIndexName(), STRIP_CHARS) | ||
+ strip(getIndexName(), STRIP_CHARS) | ||
+ "_" | ||
+ getIndexType().getSuffix(); | ||
break; | ||
case SKIPPING: | ||
indexName = | ||
"flint" | ||
+ "_" | ||
+ StringUtils.strip(fullyQualifiedTableName.getDatasourceName(), STRIP_CHARS) | ||
+ "_" | ||
+ StringUtils.strip(fullyQualifiedTableName.getSchemaName(), STRIP_CHARS) | ||
+ "_" | ||
+ StringUtils.strip(fullyQualifiedTableName.getTableName(), STRIP_CHARS) | ||
+ "_" | ||
+ getIndexType().getSuffix(); | ||
"flint_" + fullyQualifiedTableName.toFlintName() + "_" + getIndexType().getSuffix(); | ||
break; | ||
case MATERIALIZED_VIEW: | ||
indexName = "flint" + "_" + StringUtils.strip(getMvName(), STRIP_CHARS).toLowerCase(); | ||
indexName = "flint_" + new FullyQualifiedTableName(mvName).toFlintName(); | ||
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. Let me know if this is the edge case still pending. CREATE MATERIALIZED VIEW default.mv 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 think this is impossible from frontend. The reason I add check in But for API call, user can put any name. May need to validate this. 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. It can come from workbench but probably we can take that as backlog. |
||
break; | ||
} | ||
return indexName.toLowerCase(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Should we bring this constant to this File.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will merge this first. CI took so long every commit ...