-
Notifications
You must be signed in to change notification settings - Fork 42
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: add bigframes.bigquery.create_vector_index
to assist in creating vector index on ARRAY<FLOAT64>
columns
#1024
Conversation
…ing vector index on `ARRAY<FLOAT64>` columns
…into b365541165-create_vector_index
bigframes/core/sql.py
Outdated
create = "CREATE VECTOR INDEX IF NOT EXISTS " | ||
|
||
if len(stored_column_names) > 0: | ||
escaped_stored = [f"`{name}`" for name in stored_column_names] |
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 we use our existing sql utils to escape the ids? This will also escape special characters
bigframes/core/sql.py
Outdated
) | ||
|
||
return f""" | ||
{create} {index_name} |
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.
Probably should escape index_name too?
bigframes/core/sql.py
Outdated
|
||
return f""" | ||
{create} {index_name} | ||
ON `{table_name}`(`{column_name}`) |
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.
Lets reuse existing escaping logic
if index_name is None: | ||
index_name = table_id.split(".")[-1] |
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.
would reading into a TableReference be more robust?
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.
Pretty sure it's exactly the same logic there, but makes sense from the perspective of having one place for that logic (in case "." is allowed as a character in the table name someday).
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.
Done in latest commit (along with identifier
logic).
…into b365541165-create_vector_index
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes internal issue 365541165 🦕