You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "yuzelin (via GitHub)" <gi...@apache.org> on 2023/05/08 08:41:34 UTC

[GitHub] [incubator-paimon] yuzelin commented on issue #1038: [cdc] Supports taking a column of a table from MYsql and processing it as a table partition field for paimon table

yuzelin commented on issue #1038:
URL: https://github.com/apache/incubator-paimon/issues/1038#issuecomment-1537978983

   My idea is:
   1. We can add a new argument for specifying computed column, for example:
   ```
   --partition-keys dt,hr
   --computed-column dt=date(ts)
   --computed-column hr=hour(ts)
   ```
   `ts` is exsiting column, we can specify that `dt` is day of ts and `hr` is hour of ts.
   2. The newly computed column can be specified as partition key and will be auto created in Paimon table.
   3. Introduce two class to handle computed column:
   class `ComputedColumn`: store column's name, type, argument column names, and a`ColumnValueComputer` to compute value from given argument.
   
   interface `ColumnValueComputer`:  has a method `Object computeValue(Object... input)` to compute value. We can implement several concrete computers.
   
   4. Pass `ComputedColumn`s to `EventParser`. Every time `extractRow` is invoked, generate computed column values.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org