-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1729292 modify iceberg tree based on record data (#1007)
- Loading branch information
1 parent
487e7c4
commit 85db567
Showing
28 changed files
with
1,840 additions
and
290 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
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
26 changes: 26 additions & 0 deletions
26
...afka/connector/internal/streaming/schemaevolution/iceberg/IcebergColumnJsonValuePair.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,26 @@ | ||
package com.snowflake.kafka.connector.internal.streaming.schemaevolution.iceberg; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import java.util.Map; | ||
|
||
class IcebergColumnJsonValuePair { | ||
private final String columnName; | ||
private final JsonNode jsonNode; | ||
|
||
static IcebergColumnJsonValuePair from(Map.Entry<String, JsonNode> field) { | ||
return new IcebergColumnJsonValuePair(field.getKey(), field.getValue()); | ||
} | ||
|
||
IcebergColumnJsonValuePair(String columnName, JsonNode jsonNode) { | ||
this.columnName = columnName; | ||
this.jsonNode = jsonNode; | ||
} | ||
|
||
String getColumnName() { | ||
return columnName; | ||
} | ||
|
||
JsonNode getJsonNode() { | ||
return jsonNode; | ||
} | ||
} |
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
15 changes: 9 additions & 6 deletions
15
...owflake/kafka/connector/internal/streaming/schemaevolution/iceberg/IcebergColumnTree.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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
package com.snowflake.kafka.connector.internal.streaming.schemaevolution.iceberg; | ||
|
||
/** Class with object types compatible with Snowflake Iceberg table */ | ||
public class IcebergColumnTree { | ||
class IcebergColumnTree { | ||
|
||
private final IcebergFieldNode rootNode; | ||
|
||
public IcebergColumnTree(ApacheIcebergColumnSchema columnSchema) { | ||
this.rootNode = new IcebergFieldNode(columnSchema.getColumnName(), columnSchema.getSchema()); | ||
String getColumnName() { | ||
return rootNode.name; | ||
} | ||
|
||
public String buildQuery() { | ||
StringBuilder sb = new StringBuilder(); | ||
return rootNode.buildQuery(sb, "ROOT_NODE").toString(); | ||
IcebergFieldNode getRootNode() { | ||
return rootNode; | ||
} | ||
|
||
IcebergColumnTree(IcebergFieldNode rootNode) { | ||
this.rootNode = rootNode; | ||
} | ||
} |
Oops, something went wrong.