phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] vincentpoon commented on a change in pull request #462: PHOENIX-2787 support IF EXISTS for ALTER TABLE SET options
Date Tue, 12 Mar 2019 00:55:13 GMT
vincentpoon commented on a change in pull request #462: PHOENIX-2787 support IF EXISTS for
ALTER TABLE SET options
URL: https://github.com/apache/phoenix/pull/462#discussion_r264485834
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
 ##########
 @@ -3514,13 +3515,15 @@ private void mutateStringProperty(String tenantId, String schemaName,
String tab
 
     public MutationState addColumn(AddColumnStatement statement) throws SQLException {
         PTable table = FromCompiler.getResolver(statement, connection).getTables().get(0).getTable();
-        return addColumn(table, statement.getColumnDefs(), statement.getProps(), statement.ifNotExists(),
false, statement.getTable(), statement.getTableType());
+        return addColumn(table, statement.getColumnDefs(), statement.getProps(),
+                statement.ifNotExists(), false, statement.getTable(), statement.getTableType(),
+                statement.ifSetOptionExists());
     }
 
     public MutationState addColumn(PTable table, List<ColumnDef> origColumnDefs,
             ListMultimap<String, Pair<String, Object>> stmtProperties, boolean
ifNotExists,
-            boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType)
-                    throws SQLException {
+            boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType,
+                                   boolean ifSetOptionExist) throws SQLException {
 
 Review comment:
   looks like you created the `ifSetOptionsExist` boolean and passed it all the way down to
here, but never use it?
   
   The overall structure feels wrong.  This shouldn't be something specific to SetOption.
 It should apply to any "ALTER TABLE" command, including ADD/DROP column.  I think "ALTER
TABLE IF EXISTS DROP COLUMN IF EXISTS" should be a valid command.  This is what PostgreSQL
does:
   https://www.postgresql.org/docs/9.2/sql-altertable.html

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message