This is an automated email from the ASF dual-hosted git repository.

wanghailin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 87c6adcc2e [Improve] Make ClickhouseFileSinker support tables 
containing materialized columns (#6956)
87c6adcc2e is described below

commit 87c6adcc2ea0485dbbd43ee4511188997e36b1fc
Author: Felix <ddna_1...@163.com>
AuthorDate: Fri Jun 7 21:58:08 2024 +0800

    [Improve] Make ClickhouseFileSinker support tables containing materialized 
columns (#6956)
    
    * [Improvement] Make ClickhouseFileSinker support tables containing 
materialized columns by ignoring the materialized columns in the CK table when 
building the temporary table. In this way, when generating the ck part file, 
the file corresponding to the materialized column will be automatically 
generated, otherwise an error will be reported when generating the file.
    
    * Make ClickhouseFileSinker support tables containing materialized columns
    
    ---------
    
    Co-authored-by: fandonglai <fandong...@jd.com>
---
 .../seatunnel/clickhouse/sink/client/ClickhouseProxy.java          | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/ClickhouseProxy.java
 
b/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/ClickhouseProxy.java
index 9389356b3d..bf0f9a5552 100644
--- 
a/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/ClickhouseProxy.java
+++ 
b/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/ClickhouseProxy.java
@@ -139,7 +139,12 @@ public class ClickhouseProxy {
         Map<String, String> schema = new LinkedHashMap<>();
         try (ClickHouseResponse response = 
request.query(sql).executeAndWait()) {
             response.records()
-                    .forEach(r -> schema.put(r.getValue(0).asString(), 
r.getValue(1).asString()));
+                    .forEach(
+                            r -> {
+                                if 
(!"MATERIALIZED".equals(r.getValue(2).asString())) {
+                                    schema.put(r.getValue(0).asString(), 
r.getValue(1).asString());
+                                }
+                            });
         } catch (ClickHouseException e) {
             throw new ClickhouseConnectorException(
                     CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,

Reply via email to