-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Unified the grammer style of create/drop bitmap and bloomfilter index #4247
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
Conversation
| public static final ScalarType HLL = ScalarType.createHllType(); | ||
| public static final ScalarType CHAR = (ScalarType) ScalarType.createCharType(-1); | ||
| public static final ScalarType BITMAP = new ScalarType(PrimitiveType.BITMAP); | ||
| public static final ScalarType BLOOMFILTER = new ScalarType(PrimitiveType.BLOOMFILTER); |
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.
No need to add a new type bloomfilter
This bitmap is Type Bitmap, not index bitmap
| processDropIndex((DropIndexClause) alterClause, olapTable, newIndexes); | ||
| DropIndexClause clause = (DropIndexClause) alterClause; | ||
| if (getIndexTypeByName(clause, olapTable) == IndexDef.IndexType.BLOOMFILTER) { | ||
| createBfJob(db.getId(), olapTable, indexSchemaMap, propertyMap, newIndexes, true); |
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.
createBfJob is right?
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.
createBfJob is a new Function that responsible for bloomfilter index create/drop
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.
I see, but createBfJob is ambiguous
| 1. 目前只支持bitmap 索引 | ||
| 1. 目前支持bitmap,bloomfilter 索引 | ||
| 2. BITMAP 索引仅在单列上创建 | ||
| 3. BLOOMFILTER索引可以在多列上创建,当列为空时表示删除索引;属性bloom_filter_fpp表示期望误差率 |
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.
Indent to index 2.
| LOG.info("finished to create schema change job: {}", schemaChangeJob.getJobId()); | ||
| } | ||
|
|
||
| private void createBfJob(long dbId, OlapTable olapTable, Map<Long, LinkedList<Column>> indexSchemaMap, |
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.
Can you reuse the old logic in createJob
| processDropIndex((DropIndexClause) alterClause, olapTable, newIndexes); | ||
| DropIndexClause clause = (DropIndexClause) alterClause; | ||
| if (getIndexTypeByName(clause, olapTable) == IndexDef.IndexType.BLOOMFILTER) { | ||
| createBfJob(db.getId(), olapTable, indexSchemaMap, propertyMap, newIndexes, true); |
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.
I see, but createBfJob is ambiguous
| } | ||
| } | ||
| if (olapTable.getBfName() == indexName) { | ||
| found = new Index(); |
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.
Please add a comment to explain why a new Index was created here
…ailure (apache#53952) (apache#4247) 1. New tablet cloud be nullptr when get tablet action failed, take it into account. 2. Fix grammer error of the method signature.
Proposed changes
This PR is to unified the grammer style of create/drop bitmap and bloomfilter index. It supports to create bloomfilter index by using the grammar style of "create index <index_name> on <table_name> using bloomfilter comment ' ' properties ('bloom_filter_fpp'='0.04')". It is also compatible with the olde style of "alter table set ('bloom_filter_columns'='k1,k2', 'bloom_filter_fpp'='0.04')". Issue: #4193
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...