-
Notifications
You must be signed in to change notification settings - Fork 175
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
feat(java): create ivf pq index via Java #2103
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good to me, except a couple very minor exception usage and naming issue.
*/ | ||
public IndexBuilder ivfPq(int numPartitions, int numSubVectors) throws IOException { | ||
if (this.params.isPresent()) { | ||
throw new IOException("A different index parameter already set."); |
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 think it might be better to throw a runtime exception or IllegalState exception, because it's not something from IO, what do you think?
* @param numPartitions Number of IVF Partitions. | ||
* @param numSubVectors Number of PQ sub-vectors. | ||
*/ | ||
public IndexBuilder ivfPq(int numPartitions, int numSubVectors) throws IOException { |
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.
is buildIvfPqIndex()
a better method name?
/** Build a Scalar index. */ | ||
public IndexBuilder scalar() throws IOException { | ||
if (this.params.isPresent()) { | ||
throw new IOException("A different index parameter already set."); |
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.
ditto, IOException might be not appropriate here
this.replace); | ||
|
||
} else { | ||
throw new IOException("Unsupported Index Parameter"); |
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.
ditto
var params = this.params.get(); | ||
if (params instanceof IvfPqParams) { | ||
if (columns.size() != 1) { | ||
throw new IOException("Can only create IVF_PQ on one column, got: " + columns); |
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.
ditto
No description provided.