-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from jirislav/finish-complex-types-support
Add support for Tuples & Variants
- Loading branch information
Showing
22 changed files
with
1,288 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.0.17 | ||
v1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/com/clickhouse/kafka/connect/sink/db/helper/ClickHouseFieldDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.clickhouse.kafka.connect.sink.db.helper; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.extern.jackson.Jacksonized; | ||
|
||
/** | ||
* Java object representation of one DESCRIBE TABLE result row. | ||
* <p> | ||
* We use Jackson to instantiate it from JSON. | ||
*/ | ||
@Data | ||
@Builder | ||
@Jacksonized | ||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
public class ClickHouseFieldDescriptor { | ||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); | ||
private String name; | ||
private String type; | ||
private String defaultType; | ||
private String defaultExpression; | ||
private String comment; | ||
private String codecExpression; | ||
private String ttlExpression; | ||
private boolean isSubcolumn; | ||
|
||
public boolean isAlias() { | ||
return "ALIAS".equals(defaultType); | ||
} | ||
|
||
public boolean isMaterialized() { | ||
return "MATERIALIZED".equals(defaultType); | ||
} | ||
|
||
public boolean hasDefault() { | ||
return "DEFAULT".equals(defaultType); | ||
} | ||
|
||
public static ClickHouseFieldDescriptor fromJsonRow(String json) throws JsonProcessingException { | ||
return OBJECT_MAPPER.readValue(json.replace("\n", "\\n"), ClickHouseFieldDescriptor.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.