-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
Consider the following schema:
CREATE TABLE User (
Foo STRING(MAX) NOT NULL,
Bar STRING(MAX),
) PRIMARY KEY(Foo);
CREATE UNIQUE NULL_FILTERED INDEX User_Bar_index ON User(Bar);Yo will generate a FindUserByBar fn looking at its unique index. But if we run tests against that fn on spanner emu, it will fail because of this:
absl::Status NullFilteredIndexUnusable(absl::string_view index_name) {
return absl::Status(
absl::StatusCode::kInvalidArgument,
absl::Substitute(
"The emulator is not able to determine whether the "
"null filtered index $0 can be used to answer this query as it "
"may filter out nulls that may be required to answer the query. "
"Please test this query against Cloud Spanner. If you confirm "
"against Cloud Spanner that the null filtered index can be used to "
"answer the query, set the hint @{spanner_emulator."
"disable_query_null_filtered_index_check=true} on the table "
"to bypass this check in the emulator. This hint will be ignored by "
"the production Cloud Spanner service and the emulator will accept "
"the query and return a valid result when it is run with the check "
"disabled.",
index_name));
}A simple way to make it work would be passing spanner_emulator.disable_query_null_filtered_index_check=true to the emu but AFAIK there's no option on yo to do that. Maybe custom template would be a workaround here but It'd be great if upstream has a fix.
ww24 and hokuts
Metadata
Metadata
Assignees
Labels
No labels