[ 
https://issues.apache.org/jira/browse/PHOENIX-2902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15350001#comment-15350001
 ] 

James Taylor commented on PHOENIX-2902:
---------------------------------------

Thanks for the patch, [~an...@apache.org]. Here's some feedback:
- I don't think it's valid to set the IS_NAMESPACE_MAPPING_ENABLED or 
IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE on the properties passed in at connection 
time. We should just always do a remove for these properties. It doesn't really 
make sense to switch the value at all. It seems to me to be a one way street - 
once you've enabled it, that's it, it should stay enabled. You can just add a 
constant in PhoenixRuntime for properties not allowed to be set at connection 
time and remove those here in PhoenixConnection:
{code}
    private static Properties filterKnownNonProperties(Properties info) {
        Properties prunedProperties = info;
        // If we find any properties not allowed to be set at connection time, 
prune them here
        for (String property : PhoenixRuntime.IGNORE_CONNECTION_PROPERTIES) {
            if (info.containsKey(property)) {
                if (prunedProperties == info) {
                    prunedProperties = PropertiesUtil.deepCopy(info);
                }
                prunedProperties.remove(property);
            }
        }
        for (String property : PhoenixRuntime.CONNECTION_PROPERTIES) {
            if (info.containsKey(property)) {
                if (prunedProperties == info) {
                    prunedProperties = PropertiesUtil.deepCopy(info);
                }
                prunedProperties.remove(property);
            }
        }
        return prunedProperties;
    }
{code}
- I don't think this change should be made:
{code}
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java 
b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
index 1f49cbe..9ee7f3a 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
@@ -954,6 +954,7 @@ public abstract class BaseTest {
     private static void deletePriorTables(long ts, String tenantId, String 
url) throws Exception {
         Properties props = new Properties();
         props.put(QueryServices.QUEUE_SIZE_ATTRIB, Integer.toString(1024));
+        props.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, 
Boolean.toString(true));
         if (ts != HConstants.LATEST_TIMESTAMP) {
             props.setProperty(CURRENT_SCN_ATTRIB, Long.toString(ts));
         }
{code}

Otherwise, looks good.

> Adjust PhoenixDatabaseMetadata#getSchemas query if namespaces are enabled
> -------------------------------------------------------------------------
>
>                 Key: PHOENIX-2902
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2902
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.8.0
>            Reporter: James Taylor
>            Assignee: Ankit Singhal
>             Fix For: 4.8.0
>
>         Attachments: PHOENIX-2902.patch
>
>
> The call to PhoenixDatabaseMetaData.getSchemas() currently queries the 
> SYSTEM.CATALOG table to find distinct schema names. If namespaces are 
> enabled, we should likely adjust the query accordingly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to