You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEUser (
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::StatusNullFilteredIndexUnusable(absl::string_viewindex_name) {
returnabsl::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.
The text was updated successfully, but these errors were encountered:
Consider the following schema:
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:https://github.com/GoogleCloudPlatform/cloud-spanner-emulator/blob/4bc1ce05ee511713318e991fbd076b884ea404cc/common/errors.cc#L1788-L1804
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.The text was updated successfully, but these errors were encountered: