Suvrat1629 commented on PR #36059:
URL: https://github.com/apache/beam/pull/36059#issuecomment-3288811526

   @BentsiLeviav Thanks for the response
   That is a lot of information to register but I have gone through the code 
and come up with an implementation. I want to verify the approach first as I do 
not have a lot of experience with Clickhouse and this would save me time also.
   My approach:
   
   ### In `ClickHouseIO.java`:
   - Change the format specification from RowBinary to RowBinaryWithDefaults
   - Update the method call to use the new primitive-only parsing method
   
   ### In `TableSchema.java`:
   - Add a new method called parsePrimitiveValue that only handles simple 
literals
   - This method will detect complex expressions anything with parentheses, 
function names like "now", "toDate", etc. and return null for them
   - Mark the existing parseDefaultExpression method as deprecated
   - The deprecated method can delegate to the new one for backward 
compatibility
   
   ### In `ClickHouseWriter.java`:
   - Completely rewrite the writeRow method to support the new format
   - Before writing each column value, write a flag byte
   - If we have no value and no client-side default, write the "use server 
default" flag
   - If we have a value either from input or client-side default, write the 
"use provided value" flag followed by the actual data
   
   Does this fit right? Provide me comments to improve this @BentsiLeviav @Abacn


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to