-
Notifications
You must be signed in to change notification settings - Fork 1k
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
PHOENIX-7304 - Adding utilitiy method to get view index ids for given view index table #2026
base: master
Are you sure you want to change the base?
Conversation
throws IOException, SQLException { | ||
Preconditions.checkArgument(MetaDataUtil.isViewIndex(tableName)); | ||
List<String> viewIndexIdsString = new ArrayList<>(); | ||
PreparedStatement preparedStatement = connection.prepareStatement(getViewIndexIdsQuery(tableName, includeTenantViewIndexes)); |
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.
Good to have INFO log with the value of getViewIndexIdsQuery()
to help debug if something goes wrong.
final String tableName = schemaPrefix + generateUniqueName(); | ||
final String globalViewName1 = schemaPrefix + generateUniqueName(); | ||
final String globalViewName2 = schemaPrefix + generateUniqueName(); |
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.
SchemaUtil#getTableName
API is generally used. It works with null schema name.
/** | ||
* Retrieves the list of unique view index ids from SYSTEM.CATALOG for a given view index table | ||
* @param connection - Phoenix Connection | ||
* @param tableName - name of the view index table for which view index ids need to be retrieved |
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.
It looks like this is the physical name of the view Index table and not the logical name. Can you update the API document to clarify this.
} | ||
|
||
// Get view indexes ids only for global view indexes (excluding tenant view indexes) | ||
List<String> list = ViewUtil.getViewIndexIds(conn.unwrap(PhoenixConnection.class), "_IDX_" + tableName, false); |
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.
use MetatadataUtil.getViewIndexPhysicalName
instead of using hardcoded constants _IDX
Adding utilitiy method to get view index ids for given view index table
JIRA - PHOENIX-7304