swaroopak commented on a change in pull request #963:
URL: https://github.com/apache/phoenix/pull/963#discussion_r523133303



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
##########
@@ -2534,28 +2534,46 @@ else if 
(!SchemaUtil.isSystemTable(Bytes.toBytes(SchemaUtil.getTableName(schemaN
                  * 
                  */
                 if (parent != null) {
-                    encodingScheme = parent.getEncodingScheme();
-                    immutableStorageScheme = 
parent.getImmutableStorageScheme();
-                } else {
-                       Byte encodingSchemeSerializedByte = (Byte) 
TableProperty.COLUMN_ENCODED_BYTES.getValue(tableProps);
-                    if (encodingSchemeSerializedByte == null) {
-                        // Ignore default if transactional and column encoding 
is not supported (as with OMID)
-                        if (transactionProvider == null || 
!transactionProvider.getTransactionProvider().isUnsupported(PhoenixTransactionProvider.Feature.COLUMN_ENCODING)
 ) {
-                            encodingSchemeSerializedByte = 
(byte)connection.getQueryServices().getProps().getInt(QueryServices.DEFAULT_COLUMN_ENCODED_BYTES_ATRRIB,
-                                    
QueryServicesOptions.DEFAULT_COLUMN_ENCODED_BYTES);
-                            encodingScheme =  
QualifierEncodingScheme.fromSerializedValue(encodingSchemeSerializedByte);
-                        }
+                    Byte encodingSchemeSerializedByte = (Byte) 
TableProperty.COLUMN_ENCODED_BYTES.getValue(tableProps);
+                    // Table has encoding scheme defined
+                    if (encodingSchemeSerializedByte != null) {
+                        encodingScheme = getEncodingScheme(tableProps, 
schemaName, tableName, transactionProvider);
                     } else {
-                        encodingScheme =  
QualifierEncodingScheme.fromSerializedValue(encodingSchemeSerializedByte);
-                        if (encodingScheme != NON_ENCODED_QUALIFIERS && 
transactionProvider != null && 
transactionProvider.getTransactionProvider().isUnsupported(PhoenixTransactionProvider.Feature.COLUMN_ENCODING)
 ) {
-                            throw new SQLExceptionInfo.Builder(
-                                    
SQLExceptionCode.UNSUPPORTED_COLUMN_ENCODING_FOR_TXN_PROVIDER)
-                            .setSchemaName(schemaName).setTableName(tableName)
-                            .setMessage(transactionProvider.name())
-                            .build()
-                            .buildException();
+                        encodingScheme = parent.getEncodingScheme();
+                    }
+
+                    ImmutableStorageScheme immutableStorageSchemeProp = 
(ImmutableStorageScheme) 
TableProperty.IMMUTABLE_STORAGE_SCHEME.getValue(tableProps);
+                    if (immutableStorageSchemeProp == null) {
+                        immutableStorageScheme = 
parent.getImmutableStorageScheme();
+                    } else {
+                        immutableStorageScheme = 
getImmutableStorageScheme(immutableStorageSchemeProp, schemaName, tableName, 
transactionProvider);

Review comment:
       Looks like this will be called for indexes. If yes, should we rename it 
getImmutableStorageSchemeForIndex? or change the PTableImpl method to compute 
this if it is an index? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to