qingzheguo-flash opened a new issue, #10348:
URL: https://github.com/apache/seatunnel/issues/10348

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   RedisWriter custom key's placeholder when the custom_key configuration 
contains multiple layers of curly braces, it cannot generate custom_key 
correctly. This is useful when use HashTag in redis cluster mode.
   
   For example there is a SeaTunnelRow{id=1}.
   
   Actual:
   custom_key: user:{${id}}:profile -> user:${id}:profile
   
   Expect:
   custom_key: user:{${id}}:profile -> user:{1}:profile
   
   ### SeaTunnel Version
   
   dev branch version can reproduce
   
   ### SeaTunnel Config
   
   ```conf
   {
       "env" : {
           "parallelism" : 4,
           "job.mode" : "BATCH",
           "spark.app.name" : "xxx",
           "spark.executor.memory" : "32g",
           "spark.executor.instances" : "4",
           "spark.dynamicAllocation.enabled" : "false",
           "spark.kubernetes.submission.waitAppCompletion" : false,
           "spark.kubernetes.executor.deleteOnTermination" : false
       },
       "source" : [
           {
               "url" : "",
               "user" : "",
               "password" : "",
               "query" : "SELECT\n  user_id, xxx FROM\n  xxx",
               "plugin_output" : "jdbc_source",
               "plugin_name" : "Jdbc",
               "driver" : "org.apache.hive.jdbc.HiveDriver",
               "dialect" : "HIVE"
           }
       ],
       "transform" : [],
       "sink" : [
           {
               "plugin_input" : "jdbc_source",
               "plugin_name" : "Redis",
               "nodes" : [
                   "xxx"
               ],
               "mode" : "cluster",
               "support_custom_key" : "true",
               "key" : "u:{{user_id}}:member",
               "data_type" : "hash",
               "format" : "json"
           }
       ]
   }
   ```
   
   ### Running Command
   
   ```shell
   spark-submit --class 
"org.apache.seatunnel.core.starter.spark.SeaTunnelSpark" --master "k8s://" 
--deploy-mode "cluster" --name "xxx" --files 
"plugins.tar.gz,4749277_15598641_job.json" seatunnel-spark-3-starter.jar 
--config "4749277_15598641_job.json"
   ```
   
   ### Error Exception
   
   ```log
   custom key cannot generate correctly:
   
   user_id=12345
   
   custom key config: u:{{user_id}}:member
   
   Actual:u:${user_id}:member
   Expected: u:{12345}:member
   ```
   
   ### Zeta or Flink or Spark Version
   
   spark 3.3.0
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to