-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature-2582][Connector] Add Hashes && Lists in Redis Sink #2587
Changes from 2 commits
180dd7f
ea7c8bf
b4ef72d
24f58fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.seatunnel.e2e.spark.redis; | ||
|
||
import org.apache.seatunnel.e2e.spark.SparkContainer; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.testcontainers.containers.Container; | ||
|
||
import java.io.IOException; | ||
|
||
public class FakeSourceToRedisIT extends SparkContainer { | ||
|
||
@Test | ||
public void testFakeSourceToRedisSink() throws IOException, InterruptedException { | ||
Container.ExecResult execResult = executeSeaTunnelSparkJob("/jdbc/fakesource_to_redis.conf"); | ||
Assertions.assertEquals(0, execResult.getExitCode()); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,61 @@ | ||||||||||
# | ||||||||||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||||||||||
# contributor license agreements. See the NOTICE file distributed with | ||||||||||
# this work for additional information regarding copyright ownership. | ||||||||||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||||||||||
# (the "License"); you may not use this file except in compliance with | ||||||||||
# the License. You may obtain a copy of the License at | ||||||||||
# | ||||||||||
# http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||
# | ||||||||||
# Unless required by applicable law or agreed to in writing, software | ||||||||||
# distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||
# See the License for the specific language governing permissions and | ||||||||||
# limitations under the License. | ||||||||||
# | ||||||||||
###### | ||||||||||
###### This config file is a demonstration of streaming processing in seatunnel config | ||||||||||
###### | ||||||||||
|
||||||||||
env { | ||||||||||
spark.app.name = "SeaTunnel" | ||||||||||
spark.executor.instances = 2 | ||||||||||
spark.executor.cores = 1 | ||||||||||
spark.executor.memory = "1g" | ||||||||||
spark.master = local | ||||||||||
} | ||||||||||
|
||||||||||
source { | ||||||||||
# This is a example source plugin **only for test and demonstrate the feature source plugin** | ||||||||||
Fake { | ||||||||||
result_table_name = "my_dataset" | ||||||||||
schema = { | ||||||||||
fields { | ||||||||||
key = "string" | ||||||||||
hash_key = "string" | ||||||||||
item = "string" | ||||||||||
} | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
# If you would like to get more information about how to configure seatunnel and see full list of source plugins, | ||||||||||
# please go to https://seatunnel.apache.org/docs/flink/configuration/source-plugins/Fake | ||||||||||
} | ||||||||||
|
||||||||||
transform { | ||||||||||
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins, | ||||||||||
# please go to https://seatunnel.apache.org/docs/flink/configuration/transform-plugins/Sql | ||||||||||
} | ||||||||||
|
||||||||||
sink { | ||||||||||
redis { | ||||||||||
host = "localhost" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Connect to redis-server you started in testcase? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
port = 6379 | ||||||||||
data_type = "HASHES" | ||||||||||
db_num = 0 | ||||||||||
} | ||||||||||
|
||||||||||
# If you would like to get more information about how to configure seatunnel and see full list of sink plugins, | ||||||||||
# please go to https://seatunnel.apache.org/docs/flink/configuration/sink-plugins/Console | ||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reference
https://github.com/apache/incubator-seatunnel/blob/dev/seatunnel-e2e/seatunnel-spark-connector-v2-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/redis/RedisIT.java#L51
start redis-server in testcase?