[ https://issues.apache.org/jira/browse/PHOENIX-2852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15261130#comment-15261130 ]
Samarth Jain commented on PHOENIX-2852: --------------------------------------- Great! +1 > Dropping columns could trigger upgrade code on server side > ---------------------------------------------------------- > > Key: PHOENIX-2852 > URL: https://issues.apache.org/jira/browse/PHOENIX-2852 > Project: Phoenix > Issue Type: Bug > Reporter: Samarth Jain > Assignee: Thomas D'Silva > Attachments: PHOENIX-2852.patch > > > In MetadataEndPointImpl.java, I noticed that we are obtaining a Phoenix > connection by going through the Phoenix driver. This could be dangerous as it > could end up triggering the upgrade code. > {code} > // check if the view where expression contains the column being dropped and > prevent > // it > if (existingViewColumn != null && view.getViewStatement() != > null) { > ParseNode viewWhere = > new > SQLParser(view.getViewStatement()).parseQuery().getWhere(); > PhoenixConnection conn=null; > try { > conn = > QueryUtil.getConnection(env.getConfiguration()).unwrap( > PhoenixConnection.class); > } catch (ClassNotFoundException e) { > } > {code} > [~jamestaylor] has added a nice way of getting a phoenix connection without > running the upgrade by doing something like this: > {code} > final Properties props = new Properties(); > props.setProperty(PhoenixRuntime.NO_UPGRADE_ATTRIB, > Boolean.TRUE.toString()); > conn = DriverManager.getConnection(getJdbcUrl(env), > props).unwrap(PhoenixConnection.class); > {code} > [~tdsilva] - would you mind taking a look? Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332)