ydb-java-sdk icon indicating copy to clipboard operation
ydb-java-sdk copied to clipboard

Add run interval support for table ttl settings

Open pnv1 opened this issue 2 years ago • 4 comments

https://github.com/ydb-platform/ydb/blob/main/ydb/public/api/protos/ydb_table.proto#L391

pnv1 avatar Jul 19 '23 15:07 pnv1

Hi,I want to contribute to this issue.Can you just guide me through it?I do not have much experience with it but I am willing to learn and contribute:smile:.

Hmd02 avatar Jul 19 '23 16:07 Hmd02

You are welcome!) For beginning, you can took at repository java-genproto, it contains java classes generated from proto specs. You can just update usage of TtlSettings in classes CreateTableSettings, AlterTableSettings and TableDescription

alex268 avatar Jul 20 '23 07:07 alex268

Hi,I read the proto specs and CreateTableSettings,AlterTableSetting.But I didn't understand how exactly are these classes using TtlSettings because it just returns ttlSetting object without performing any action/modifications.Then I looked up in BaseSession class where objects of CreateTableSettings, AlterTableSettings class set the expirySeconds and ColumnName for object of YdbTable.DateTypeColumnModeSettings.Builder class generated by proto.Can you help me understand how exactly do I need to update CreateTableSettings, AlterTableSettings ,what role do these classes play,and where does run_interval come into play.Thanks!!

Hmd02 avatar Jul 21 '23 09:07 Hmd02

Classes CreateTableSettings and AlterTableSettings are helpers for proto classes in YdbTable. Because direct usage of YdbTable is very unusual we made helpers for every proto message. Current implementation of TtlSettings and BaseSession supports only DataTypeColumnModeSettings and doesn't support ValueSinceUnixEpochModeSettings and run_interval_seconds. You can see it in this code which constructs CreateTableRequest message. For resolving this issue we have to add new field to class TtlSettings and also add correct constructing of CreateTableRequest and AlterTableRequest in BaseSession's methods createTable and alterTable

alex268 avatar Jul 24 '23 07:07 alex268