[
https://issues.apache.org/jira/browse/PHOENIX-4763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16709097#comment-16709097
]
ASF GitHub Bot commented on PHOENIX-4763:
-----------------------------------------
Github user twdsilva commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/408#discussion_r238790586
--- Diff:
phoenix-core/src/test/java/org/apache/phoenix/util/MetaDataUtilTest.java ---
@@ -65,21 +100,67 @@ public void testCompatibility() {
@Test
public void testMutatingAPut() throws Exception {
- String version = VersionInfo.getVersion();
- KeyValueBuilder builder = KeyValueBuilder.get(version);
- byte[] row = Bytes.toBytes("row");
- byte[] family = PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES;
- byte[] qualifier = Bytes.toBytes("qual");
- byte[] value = Bytes.toBytes("generic-value");
- KeyValue kv = builder.buildPut(wrap(row), wrap(family),
wrap(qualifier), wrap(value));
- Put put = new Put(row);
- KeyValueBuilder.addQuietly(put, builder, kv);
+ Put put = generateOriginalPut();
byte[] newValue = Bytes.toBytes("new-value");
- Cell cell = put.get(family, qualifier).get(0);
- assertEquals(Bytes.toString(value),
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
- MetaDataUtil.mutatePutValue(put, family, qualifier, newValue);
- cell = put.get(family, qualifier).get(0);
- assertEquals(Bytes.toString(newValue),
Bytes.toString(cell.getValueArray(), cell.getValueOffset(),
cell.getValueLength()));
+ Cell cell = put.get(TABLE_FAMILY_BYTES, QUALIFIER).get(0);
+ assertEquals(Bytes.toString(ORIGINAL_VALUE),
+ Bytes.toString(cell.getValueArray(),
cell.getValueOffset(), cell.getValueLength()));
+ MetaDataUtil.mutatePutValue(put, TABLE_FAMILY_BYTES, QUALIFIER,
newValue);
+ cell = put.get(TABLE_FAMILY_BYTES, QUALIFIER).get(0);
+ assertEquals(Bytes.toString(newValue),
+ Bytes.toString(cell.getValueArray(),
cell.getValueOffset(), cell.getValueLength()));
+ }
+
--- End diff --
Nice unit tests.
> Changing a base table property value should be reflected in child views (if
> the property wasn't changed)
> --------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-4763
> URL: https://issues.apache.org/jira/browse/PHOENIX-4763
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Thomas D'Silva
> Assignee: Chinmay Kulkarni
> Priority: Major
> Attachments: PHOENIX-4763.patch
>
>
> .. for properties that are valid on views.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)