Uh oh!
There was an error while loading. Please reload this page.
Spanner: Read multiple keys with index - #4386
Conversation
0d0299e to
177df9cComparedhermes
commented
Nov 13, 2017
@chemelnucfin Don't forget to add relevant labels to PRs as well as issues |
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
177df9c to
a9bd0ccCompare| 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.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| [[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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
tseaver
commented
Nov 13, 2017
Ugh, @chemelnucfin my review comments predated your force push. They are still probably valid. |
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| KeySet(keys=keyset), | ||
| index='name') | ||
| ) | ||
| temp_db.drop() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
a9bd0cc to
c1f7d3cComparechemelnucfin
commented
Nov 14, 2017
@tseaver PTAL, thanks. |
| 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.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
060e73d to
7b931ffCompare7b931ff to
2ea8daaComparechemelnucfin
commented
Dec 5, 2017
@tseaver PTAL, thanks. |
reads multiple keys using index