Fix dclocal_read_repair_chance table metadata
Fixes PYTHON-84
This commit is contained in:
@@ -36,6 +36,8 @@ Bug Fixes
|
|||||||
(PYTHON-81)
|
(PYTHON-81)
|
||||||
* Properly defunct connections after protocol errors
|
* Properly defunct connections after protocol errors
|
||||||
* Avoid UnicodeDecodeError when query string is unicode (PYTHON-76)
|
* Avoid UnicodeDecodeError when query string is unicode (PYTHON-76)
|
||||||
|
* Correctly capture dclocal_read_repair_chance for tables and
|
||||||
|
use it when generating CREATE TABLE statements (PYTHON-84)
|
||||||
|
|
||||||
2.0.2
|
2.0.2
|
||||||
=====
|
=====
|
||||||
|
@@ -301,6 +301,16 @@ class Metadata(object):
|
|||||||
def _build_table_options(self, row):
|
def _build_table_options(self, row):
|
||||||
""" Setup the mostly-non-schema table options, like caching settings """
|
""" Setup the mostly-non-schema table options, like caching settings """
|
||||||
options = dict((o, row.get(o)) for o in TableMetadata.recognized_options if o in row)
|
options = dict((o, row.get(o)) for o in TableMetadata.recognized_options if o in row)
|
||||||
|
|
||||||
|
# the option name when creating tables is "dclocal_read_repair_chance",
|
||||||
|
# but the column name in system.schema_columnfamilies is
|
||||||
|
# "local_read_repair_chance". We'll store this as dclocal_read_repair_chance,
|
||||||
|
# since that's probably what users are expecting (and we need it for the
|
||||||
|
# CREATE TABLE statement anyway).
|
||||||
|
if "local_read_repair_chance" in options:
|
||||||
|
val = options.pop("local_read_repair_chance")
|
||||||
|
options["dc_local_read_repair_chance"] = val
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
||||||
def _build_column_metadata(self, table_metadata, row):
|
def _build_column_metadata(self, table_metadata, row):
|
||||||
@@ -662,7 +672,8 @@ class TableMetadata(object):
|
|||||||
recognized_options = (
|
recognized_options = (
|
||||||
"comment",
|
"comment",
|
||||||
"read_repair_chance",
|
"read_repair_chance",
|
||||||
"dclocal_read_repair_chance",
|
"dclocal_read_repair_chance", # kept to be safe, but see _build_table_options()
|
||||||
|
"local_read_repair_chance",
|
||||||
"replicate_on_write",
|
"replicate_on_write",
|
||||||
"gc_grace_seconds",
|
"gc_grace_seconds",
|
||||||
"bloom_filter_fp_chance",
|
"bloom_filter_fp_chance",
|
||||||
|
Reference in New Issue
Block a user