-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
896c345
commit e66e738
Showing
12 changed files
with
149 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "SNOWFLAKE_CONNECTOR_NAME", | ||
"config": { | ||
"connector.class": "com.snowflake.kafka.connector.SnowflakeSinkConnector", | ||
"topics": "SNOWFLAKE_TEST_TOPIC", | ||
"tasks.max": "1", | ||
"buffer.size.bytes": "5000000", | ||
"snowflake.url.name": "SNOWFLAKE_HOST", | ||
"snowflake.user.name": "SNOWFLAKE_USER", | ||
"snowflake.private.key": "SNOWFLAKE_PRIVATE_KEY", | ||
"snowflake.database.name": "SNOWFLAKE_DATABASE", | ||
"snowflake.schema.name": "SNOWFLAKE_SCHEMA", | ||
"snowflake.role.name": "SNOWFLAKE_ROLE", | ||
"snowflake.ingestion.method": "SNOWPIPE_STREAMING", | ||
"key.converter": "org.apache.kafka.connect.json.JsonConverter", | ||
"value.converter":"io.confluent.connect.avro.AvroConverter", | ||
"value.converter.schema.registry.url":"CONFLUENT_SCHEMA_REGISTRY", | ||
"value.converter.schemas.enable": "false", | ||
"jmx": "true", | ||
"errors.tolerance": "all", | ||
"errors.log.enable": true, | ||
"errors.deadletterqueue.topic.name": "DLQ_TOPIC", | ||
"errors.deadletterqueue.topic.replication.factor": 1, | ||
"snowflake.streaming.iceberg.enabled": true, | ||
"snowflake.streaming.max.client.lag": "1" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Avro binary file generated from json: | ||
java -jar avro-tools-1.12.0.jar fromjson --schema-file test_user.avsc steve.json > steve.avro |
Binary file not shown.
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,7 @@ | ||
{ | ||
"id": 1, | ||
"body_temperature": 36.6, | ||
"name": "Steve", | ||
"approved_coffee_types": ["Espresso", "Doppio", "Ristretto", "Lungo"], | ||
"animals_possessed": {"dogs": true, "cats": false} | ||
} |
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,33 @@ | ||
{ | ||
"namespace": "com.snowflake.kafka.connector", | ||
"type": "record", | ||
"name": "TestUser", | ||
"fields": [ | ||
{ | ||
"name": "id", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "body_temperature", | ||
"type": "float" | ||
}, | ||
{ | ||
"name": "name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "approved_coffee_types", | ||
"type": { | ||
"type": "array", | ||
"items": "string" | ||
} | ||
}, | ||
{ | ||
"name": "animals_possessed", | ||
"type": { | ||
"type": "map", | ||
"values": "boolean" | ||
} | ||
} | ||
] | ||
} |
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,29 @@ | ||
from test_suit.test_utils import RetryableError, NonRetryableError | ||
from test_suit.base_e2e import BaseE2eTest | ||
|
||
|
||
class TestIcebergAvroAws(BaseE2eTest): | ||
def __init__(self, driver, nameSalt): | ||
self.driver = driver | ||
self.fileName = "iceberg_avro_aws" | ||
self.topic = self.fileName + nameSalt | ||
|
||
def getConfigFileName(self): | ||
return self.fileName + ".json" | ||
|
||
def send(self): | ||
avroBytes = open(self.driver.TEST_DATA_FOLDER + "avro/steve.avro", "rb").read() | ||
key = [] | ||
value = [] | ||
|
||
for e in range(100): | ||
key.append(json.dumps({'number': str(e)}).encode('utf-8')) | ||
value.append(avroBytes) | ||
self.driver.sendBytesData(self.topic, value, key) | ||
|
||
def verify(self, round): | ||
res = self.driver.select_number_of_records(self.topic) | ||
print("Count records in table {}={}".format(self.topic, str(res))) | ||
|
||
def clean(self): | ||
self.driver.cleanTableStagePipe(self.topic) |
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