-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Spanner: Read multiple keys with index #4386
Spanner: Read multiple keys with index #4386
Conversation
0d0299e
to
177df9c
Compare
@chemelnucfin Don't forget to add relevant labels to PRs as well as issues |
spanner/tests/system/test_system.py
Outdated
def test_read_with_multiple_keys_index(self): | ||
ROW_COUNT = 10 | ||
EXTRA_DDL = ['CREATE INDEX name ON contacts(first_name, last_name)'] | ||
MY_COLUMNS = self.COLUMNS[1], self.COLUMNS[2] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
pool = BurstyPool() | ||
|
||
temp_db = Config.INSTANCE.database( | ||
'test_read_multi_keys_index', ddl_statements=DDL_STATEMENTS + EXTRA_DDL, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
177df9c
to
a9bd0cc
Compare
spanner/tests/system/test_system.py
Outdated
pool = BurstyPool() | ||
|
||
temp_db = Config.INSTANCE.database( | ||
'test_read_multi_keys_index', ddl_statements=DDL_STATEMENTS + EXTRA_DDL, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
self.to_delete.append(session) | ||
expected = list( | ||
[[row[1], row[2]] for | ||
index, row in enumerate(self._row_data(ROW_COUNT))]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
[[row[1], row[2]] for | ||
index, row in enumerate(self._row_data(ROW_COUNT))]) | ||
keyset = [(expected[index][0], expected[index][1]) for | ||
index in range(len(expected))] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
MY_COLUMNS, | ||
KeySet(keys=keyset), | ||
index='name')) | ||
temp_db.drop() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Ugh, @chemelnucfin my review comments predated your force push. They are still probably valid. |
spanner/tests/system/test_system.py
Outdated
if not temp_db.exists(): # prevent Conflicts | ||
operation = temp_db.create() | ||
self.to_delete.append(_DatabaseDropper(temp_db)) | ||
operation.result(90) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
expected = list( | ||
[[row[1], row[2]] for | ||
index, row in enumerate(self._row_data(ROW_COUNT))] | ||
) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
keyset = [ | ||
(expected[index][0], expected[index][1]) for | ||
index in range(len(expected)) | ||
] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
KeySet(keys=keyset), | ||
index='name') | ||
) | ||
temp_db.drop() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
a9bd0cc
to
c1f7d3c
Compare
@tseaver PTAL, thanks. |
spanner/tests/system/test_system.py
Outdated
ddl_create = ['CREATE INDEX name ON contacts(first_name, last_name)'] | ||
columns = self.COLUMNS[1], self.COLUMNS[2] | ||
try: | ||
operation = self._db.update_ddl(ddl_create) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
session, committed = self._set_up_table(row_count, db=self._db) | ||
self.to_delete.append(session) | ||
expected = [[row[1], row[2]] for row in self._row_data(row_count)] | ||
keyset = [(row[0], row[1]) for row in expected] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
060e73d
to
7b931ff
Compare
7b931ff
to
2ea8daa
Compare
@tseaver PTAL, thanks. |
reads multiple keys using index