-
Notifications
You must be signed in to change notification settings - Fork 111
TAJO-2165: Add 'ALTER TABLE UNSET PROPERTY' statement to Tajo DDL #1036
Conversation
…leType#UNSET_PROPERTY, AlterTableDescProto#property_keys 추가.
…bstractDBStore#alterTable에 위 메소드를 호출하는 기능 추가. 3. TestCatalog#testAlterTableName -> TestCatalog#testAlterTable 4. TestCatalog#createMockAlterTableUnsetProperty 헬퍼 메소드 추가. 5. TestCatalog#testAlterTable에 AbstractDBStore#unsetProperties 테스트 추가.
…rotobuf message 기능 구현
…talogUtil#unsetProperty를 호출해 주는 기능 추가.
Thank you for your patch. I'll review soon. Would you please check the test failure? |
…된 property를 unset하도록 수정
Updated! Thanks for your immediate response. Followings are additional comments on this issue:
|
… 존재성만을 검증하도록 수정. (instance별로 달라질 수 있는 값)
Thank you for the quick update. Here are my answers.
|
Oh, my mistake. I confused HCatalogStore with HiveCatalogStore. Let's sum up. The following is the list of tickets that should be opened. Some of them are from this discussion, and the others are what I found during this work. (I think it is better to implement disabling unset timezone feature on separate issue, not here.)
If you have any opinion, don't hesitate to comment to me. If you merge and close this request without any comments, I will regard it you accepted my proposal. Thanks again for your guidance! :) |
@@ -552,6 +552,16 @@ public static AlterTableDesc setProperty(String tableName, KeyValueSet params, A | |||
return alterTableDesc; | |||
} | |||
|
|||
public static AlterTableDesc unsetProperty(String tableName, String[] propertyKeys, AlterTableType alterTableType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alterTableType
must be UNSET_PROPERTY
, so the last parameter looks unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know. But I did it for the consistency with the other AlterTable methods: CatalogUtil#renameColumn, renameTable, addNewColumn and setProperty. How about clear this issue with AlterTableNode#clone? These methods worth to be refined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. All those methods need to be refined. But, IMO, they are all internal APIs, and don't have to be consistent. So, I think that the new method has a better signature.
Hi @dongjinleekr, I looked over your patch. It looks good to me in overall. I left a single trivial comment. |
tableMeta = tableDesc.getMeta(); | ||
assertEquals(tableMeta.getPropertySet().size(), 2); | ||
assertNotNull(tableMeta.getProperty("timezone")); | ||
assertNotNull(tableMeta.getProperty("text.null")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should verify the unset property.
remove final parameter. see: apache#1036 (comment)
Add non-existence check for unsetted property. see: apache#1036 (comment)
@jihoonson @jinossy Thanks for your comments. I applied all of them. (You can see the link to the comment in the log message of each commit.) Thanks for reviewing! |
As soon as you accept this pull request, I will request another one - the fix for the glitches discussed in this issue. I already completed that work. :) |
@@ -43,6 +44,8 @@ | |||
private AlterTableOpType alterTableOpType; | |||
@Expose @SerializedName("TableProperties") | |||
private Map<String, String> params; | |||
@Expose @SerializedName("TablePropertyKeys") | |||
private List<String> propertyKeys; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to change this variable to be more intuitive as well. I think getter and setter also need to be changed together.
@dongjinleekr thank you for the quick update! I left my last comment. |
+1. The latest patch looks good to me. |
+1 |
No description provided.